mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kbuild: support simultaneous "make %config" and "make all"
@ 2014-04-09  6:51 Masahiro Yamada
  2014-04-30 15:35 ` Michal Marek
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2014-04-09  6:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, Masahiro Yamada, Michal Marek, Sam Ravnborg

Kbuild is supposed to support mixed targets. (%config and build targets)

But "make all" did nothing if it was run with configuration targets.
For example,

  $ LANG=C make defconfig all
    HOSTCC  scripts/basic/fixdep
    HOSTCC  scripts/kconfig/conf.o
    SHIPPED scripts/kconfig/zconf.tab.c
    SHIPPED scripts/kconfig/zconf.lex.c
    SHIPPED scripts/kconfig/zconf.hash.c
    HOSTCC  scripts/kconfig/zconf.tab.o
    HOSTLD  scripts/kconfig/conf
  *** Default configuration is based on 'x86_64_defconfig'
  #
  # configuration written to .config
  #
  make: Nothing to be done for `all'.

This commits allows "make %config all" and makes sure
mixed targets are built one by one in the given order.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Michal Marek <mmarek@suse.cz>
CC: Sam Ravnborg <sam@ravnborg.org>
---
 Makefile           | 12 ++++++++++--
 scripts/mkmakefile | 15 ++++-----------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index 4eadf2d..40f731b 100644
--- a/Makefile
+++ b/Makefile
@@ -486,8 +486,16 @@ ifeq ($(mixed-targets),1)
 # We're called with mixed targets (*config and build targets).
 # Handle them one by one.
 
-%:: FORCE
-	$(Q)$(MAKE) -C $(srctree) KBUILD_SRC= $@
+PHONY += $(MAKECMDGOALS) __build_one_by_one
+
+$(filter-out __build_one_by_one, $(MAKECMDGOALS)): __build_one_by_one
+	@:
+
+__build_one_by_one:
+	$(Q)set -e; \
+	for i in $(MAKECMDGOALS); do \
+		$(MAKE) -f $(srctree)/Makefile $$i; \
+	done
 
 else
 ifeq ($(config-targets),1)
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 0cc0442..84af27b 100644
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -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
-- 
1.8.3.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: support simultaneous "make %config" and "make all"
  2014-04-09  6:51 [PATCH] kbuild: support simultaneous "make %config" and "make all" Masahiro Yamada
@ 2014-04-30 15:35 ` Michal Marek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Marek @ 2014-04-30 15:35 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kernel, linux-kbuild, Sam Ravnborg

On Wed, Apr 09, 2014 at 03:51:35PM +0900, Masahiro Yamada wrote:
> Kbuild is supposed to support mixed targets. (%config and build targets)
> 
> But "make all" did nothing if it was run with configuration targets.
> For example,
> 
>   $ LANG=C make defconfig all
>     HOSTCC  scripts/basic/fixdep
>     HOSTCC  scripts/kconfig/conf.o
>     SHIPPED scripts/kconfig/zconf.tab.c
>     SHIPPED scripts/kconfig/zconf.lex.c
>     SHIPPED scripts/kconfig/zconf.hash.c
>     HOSTCC  scripts/kconfig/zconf.tab.o
>     HOSTLD  scripts/kconfig/conf
>   *** Default configuration is based on 'x86_64_defconfig'
>   #
>   # configuration written to .config
>   #
>   make: Nothing to be done for `all'.
> 
> This commits allows "make %config all" and makes sure
> mixed targets are built one by one in the given order.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Michal Marek <mmarek@suse.cz>
> CC: Sam Ravnborg <sam@ravnborg.org>

Applied to kbuild.git#kbuild, thanks.

Michal

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-30 15:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-09  6:51 [PATCH] kbuild: support simultaneous "make %config" and "make all" Masahiro Yamada
2014-04-30 15:35 ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®