Commit 9319f453 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Michal Marek

kbuild: support simultaneous "make %config" and "make all"

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: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Michal Marek <mmarek@suse.cz>
CC: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent a86fe353
...@@ -500,8 +500,16 @@ ifeq ($(mixed-targets),1) ...@@ -500,8 +500,16 @@ ifeq ($(mixed-targets),1)
# We're called with mixed targets (*config and build targets). # We're called with mixed targets (*config and build targets).
# Handle them one by one. # Handle them one by one.
%:: FORCE PHONY += $(MAKECMDGOALS) __build_one_by_one
$(Q)$(MAKE) -C $(srctree) KBUILD_SRC= $@
$(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 else
ifeq ($(config-targets),1) ifeq ($(config-targets),1)
......
...@@ -42,18 +42,11 @@ MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$ ...@@ -42,18 +42,11 @@ MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$
MAKEFLAGS += --no-print-directory MAKEFLAGS += --no-print-directory
.PHONY: all \$(MAKECMDGOALS) .PHONY: __sub-make \$(MAKECMDGOALS)
all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) __sub-make:
\$(Q)\$(MAKE) \$(MAKEARGS) \$(MAKECMDGOALS)
all: \$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make
\$(Q)\$(MAKE) \$(MAKEARGS) \$(all)
Makefile:;
\$(all): all
@:
%/: all
@: @:
EOF EOF
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment