kbuild: sync mixed targets handling with Linux 3.16
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Tue, 5 Aug 2014 06:56:44 +0000 (15:56 +0900)
committerTom Rini <trini@ti.com>
Thu, 21 Aug 2014 16:01:11 +0000 (12:01 -0400)
"make %_config all" was supported for the first time in U-Boot:
  commit 53bca5ab
  kbuild: support simultaneous board configuration and "make all"

Surprisingly it had not been working in Linux Kernel for a long time.

So I sent back the patch to the Linux Kbuild community and it was
accepted with a little code improvement, at commit 9319f453.

Now, you can do "make defconfig all" or "make %_defconfig all"
in Linux too.

This commit updates some scripts to fill the code-diff
between Linux and U-Boot.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Makefile
scripts/mkmakefile

index 38bd7a8f430d0027c79d0593d6b424e758504e77..de65e2169bdebefc77afb896279c3a4364d74281 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -437,12 +437,12 @@ ifeq ($(mixed-targets),1)
 # We're called with mixed targets (*config and build targets).
 # Handle them one by one.
 
-PHONY += $(MAKECMDGOALS) build-one-by-one
+PHONY += $(MAKECMDGOALS) __build_one_by_one
 
-$(MAKECMDGOALS): build-one-by-one
+$(filter-out __build_one_by_one, $(MAKECMDGOALS)): __build_one_by_one
        @:
 
-build-one-by-one:
+__build_one_by_one:
        $(Q)set -e; \
        for i in $(MAKECMDGOALS); do \
                $(MAKE) -f $(srctree)/Makefile $$i; \
index 0cc04426074403458583b73339754c2a588bfa13..84af27bf0f99fc8983564eebaf63aed7797e7a30 100644 (file)
@@ -42,18 +42,11 @@ MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$
 
 MAKEFLAGS += --no-print-directory
 
-.PHONY: all \$(MAKECMDGOALS)
+.PHONY: __sub-make \$(MAKECMDGOALS)
 
-all    := \$(filter-out all Makefile,\$(MAKECMDGOALS))
+__sub-make:
+       \$(Q)\$(MAKE) \$(MAKEARGS) \$(MAKECMDGOALS)
 
-all:
-       \$(Q)\$(MAKE) \$(MAKEARGS) \$(all)
-
-Makefile:;
-
-\$(all): all
-       @:
-
-%/: all
+\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make
        @:
 EOF