lkml.org 
[lkml]   [2018]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] kbuild: simplify command line creation in scripts/mkmakefile
Date
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>
---

scripts/mkmakefile | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 85995f9..412f13f 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
@:
--
2.7.4
\
 
 \ /
  Last update: 2018-09-18 10:47    [W:0.043 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site