.. | .. |
---|
6 | 6 | |
---|
7 | 7 | # Usage |
---|
8 | 8 | # $1 - Kernel src directory |
---|
9 | | -# $2 - Output directory |
---|
10 | | -# $3 - version |
---|
11 | | -# $4 - patchlevel |
---|
12 | 9 | |
---|
13 | | - |
---|
14 | | -test ! -r $2/Makefile -o -O $2/Makefile || exit 0 |
---|
15 | | -# Only overwrite automatically generated Makefiles |
---|
16 | | -# (so we do not overwrite kernel Makefile) |
---|
17 | | -if test -e $2/Makefile && ! grep -q Automatically $2/Makefile |
---|
18 | | -then |
---|
19 | | - exit 0 |
---|
20 | | -fi |
---|
21 | 10 | if [ "${quiet}" != "silent_" ]; then |
---|
22 | | - echo " GEN $2/Makefile" |
---|
| 11 | + echo " GEN Makefile" |
---|
23 | 12 | fi |
---|
24 | 13 | |
---|
25 | | -cat << EOF > $2/Makefile |
---|
| 14 | +cat << EOF > Makefile |
---|
26 | 15 | # Automatically generated by $0: don't edit |
---|
27 | | - |
---|
28 | | -VERSION = $3 |
---|
29 | | -PATCHLEVEL = $4 |
---|
30 | | - |
---|
31 | | -lastword = \$(word \$(words \$(1)),\$(1)) |
---|
32 | | -makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST))) |
---|
33 | | - |
---|
34 | | -ifeq ("\$(origin V)", "command line") |
---|
35 | | -VERBOSE := \$(V) |
---|
36 | | -endif |
---|
37 | | -ifneq (\$(VERBOSE),1) |
---|
38 | | -Q := @ |
---|
39 | | -endif |
---|
40 | | - |
---|
41 | | -MAKEARGS := -C $1 |
---|
42 | | -MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir)) |
---|
43 | | - |
---|
44 | | -MAKEFLAGS += --no-print-directory |
---|
45 | | - |
---|
46 | | -.PHONY: __sub-make \$(MAKECMDGOALS) |
---|
47 | | - |
---|
48 | | -__sub-make: |
---|
49 | | - \$(Q)\$(MAKE) \$(MAKEARGS) \$(MAKECMDGOALS) |
---|
50 | | - |
---|
51 | | -\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make |
---|
52 | | - @: |
---|
| 16 | +include $1/Makefile |
---|
53 | 17 | EOF |
---|