aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mkmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mkmakefile')
-rw-r--r--scripts/mkmakefile10
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
25VERSION = $3 25VERSION = $3
26PATCHLEVEL = $4 26PATCHLEVEL = $4
27 27
28KERNELSRC := $1 28lastword = \$(word \$(words \$(1)),\$(1))
29KERNELOUTPUT := $2 29makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST)))
30
31MAKEARGS := -C $1
32MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir))
30 33
31MAKEFLAGS += --no-print-directory 34MAKEFLAGS += --no-print-directory
32 35
@@ -35,10 +38,11 @@ MAKEFLAGS += --no-print-directory
35all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) 38all := \$(filter-out all Makefile,\$(MAKECMDGOALS))
36 39
37all: 40all:
38 \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$(all) 41 \$(MAKE) \$(MAKEARGS) \$(all)
39 42
40Makefile:; 43Makefile:;
41 44
42\$(all) %/: all 45\$(all) %/: all
43 @: 46 @:
47
44EOF 48EOF