diff mbox series

[4/6] kbuild: mkmakefile: generate a simple wrapper of top Makefile

Message ID 1553947458-8311-4-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit 48b5ffd1268788afb01525e71e864e901e9aa070
Headers show
Series [1/6] kbuild: pass $(MAKECMDGOALS) to sub-make as is | expand

Commit Message

Masahiro Yamada March 30, 2019, 12:04 p.m. UTC
Now that Kbuild is able to start from any directory, the generated
Makefile can simply wrap the top Makefile.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

 scripts/mkmakefile | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

-- 
2.7.4

Comments

Kieran Bingham April 2, 2019, 8:02 a.m. UTC | #1
Hi Yamada-san,

On 30/03/2019 12:04, Masahiro Yamada wrote:
> Now that Kbuild is able to start from any directory, the generated

> Makefile can simply wrap the top Makefile.


This is a really nice simplification :)

Reviewed-by: Kieran Bingham <kbingham@kernel.org>


> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

> ---

> 

>  scripts/mkmakefile | 20 ++------------------

>  1 file changed, 2 insertions(+), 18 deletions(-)

> 

> diff --git a/scripts/mkmakefile b/scripts/mkmakefile

> index 31de468..4d0faeb 100755

> --- a/scripts/mkmakefile

> +++ b/scripts/mkmakefile

> @@ -12,22 +12,6 @@ if [ "${quiet}" != "silent_" ]; then

>  fi

>  

>  cat << EOF > Makefile

> -# Automatically generated by $0: don't edit

> -

> -ifeq ("\$(origin V)", "command line")

> -VERBOSE := \$(V)

> -endif

> -ifneq (\$(VERBOSE),1)

> -Q := @

> -endif

> -

> -MAKEFLAGS += --no-print-directory

> -

> -.PHONY: __sub-make \$(MAKECMDGOALS)

> -

> -__sub-make:

> -	\$(Q)\$(MAKE) -C $1 O=\$(CURDIR) \$(MAKECMDGOALS)

> -

> -\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make

> -	@:

> +# Automatically generated by $(realpath $0): don't edit

> +include $(realpath $1/Makefile)

>  EOF

> 



-- 
--
Kieran
diff mbox series

Patch

diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 31de468..4d0faeb 100755
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -12,22 +12,6 @@  if [ "${quiet}" != "silent_" ]; then
 fi
 
 cat << EOF > Makefile
-# Automatically generated by $0: don't edit
-
-ifeq ("\$(origin V)", "command line")
-VERBOSE := \$(V)
-endif
-ifneq (\$(VERBOSE),1)
-Q := @
-endif
-
-MAKEFLAGS += --no-print-directory
-
-.PHONY: __sub-make \$(MAKECMDGOALS)
-
-__sub-make:
-	\$(Q)\$(MAKE) -C $1 O=\$(CURDIR) \$(MAKECMDGOALS)
-
-\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make
-	@:
+# Automatically generated by $(realpath $0): don't edit
+include $(realpath $1/Makefile)
 EOF