diff options
Diffstat (limited to 'scripts/mkmakefile')
-rw-r--r-- | scripts/mkmakefile | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/mkmakefile b/scripts/mkmakefile index e0f54b9d8fec..e65d8b33faa4 100644 --- a/scripts/mkmakefile +++ b/scripts/mkmakefile | |||
@@ -25,8 +25,11 @@ cat << EOF > $2/Makefile | |||
25 | VERSION = $3 | 25 | VERSION = $3 |
26 | PATCHLEVEL = $4 | 26 | PATCHLEVEL = $4 |
27 | 27 | ||
28 | KERNELSRC := $1 | 28 | lastword = \$(word \$(words \$(1)),\$(1)) |
29 | KERNELOUTPUT := $2 | 29 | makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST))) |
30 | |||
31 | MAKEARGS := -C $1 | ||
32 | MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir)) | ||
30 | 33 | ||
31 | MAKEFLAGS += --no-print-directory | 34 | MAKEFLAGS += --no-print-directory |
32 | 35 | ||
@@ -35,10 +38,11 @@ MAKEFLAGS += --no-print-directory | |||
35 | all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) | 38 | all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) |
36 | 39 | ||
37 | all: | 40 | all: |
38 | \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$(all) | 41 | \$(MAKE) \$(MAKEARGS) \$(all) |
39 | 42 | ||
40 | Makefile:; | 43 | Makefile:; |
41 | 44 | ||
42 | \$(all) %/: all | 45 | \$(all) %/: all |
43 | @: | 46 | @: |
47 | |||
44 | EOF | 48 | EOF |