diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-09-18 11:45:54 +0300 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-10-04 16:56:02 +0300 |
commit | 80d0dda3a4e5ba00ae6a45fa840096dc9633aad7 (patch) | |
tree | 4f2bb427115c65725c267d2917a3dc7ffeffa695 | |
parent | 4fd61277f66278d7ce4a77accb662d00e800cce7 (diff) | |
download | linux-80d0dda3a4e5ba00ae6a45fa840096dc9633aad7.tar.xz |
kbuild: simplify command line creation in scripts/mkmakefile
Assuming we never invoke the generated Makefile from outside of
the $(objtree) directory, $(CURDIR) points to the absolute path
of $(objtree).
BTW, 'lastword' is natively supported by GNU Make 3.81+, which
is the current requirement for building the kernel.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rwxr-xr-x | scripts/mkmakefile | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/scripts/mkmakefile b/scripts/mkmakefile index 85995f90e5c8..412f13fdff52 100755 --- a/scripts/mkmakefile +++ b/scripts/mkmakefile @@ -20,9 +20,6 @@ fi cat << EOF > Makefile # Automatically generated by $0: don't edit -lastword = \$(word \$(words \$(1)),\$(1)) -makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST))) - ifeq ("\$(origin V)", "command line") VERBOSE := \$(V) endif @@ -30,15 +27,12 @@ ifneq (\$(VERBOSE),1) Q := @ endif -MAKEARGS := -C $1 -MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir)) - MAKEFLAGS += --no-print-directory .PHONY: __sub-make \$(MAKECMDGOALS) __sub-make: - \$(Q)\$(MAKE) \$(MAKEARGS) \$(MAKECMDGOALS) + \$(Q)\$(MAKE) -C $1 O=\$(CURDIR) \$(MAKECMDGOALS) \$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make @: |