aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2015-03-13 02:21:39 -0400
committerMichal Marek <mmarek@suse.cz>2015-03-24 11:48:44 -0400
commitb9fe99c5b994c6ddc57780993966b18899526c0b (patch)
treeba5f85ed5775ada4883e3b150f37be497e5e2544
parentde4619937229378e81f95e99c9866acc8e207d34 (diff)
kbuild: mergeconfig: move an error check to merge_config.sh
Currently, "make tinyconfig" does not work with "-j" option. $ make mrproper $ make -j8 tinyconfig 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 scripts/kconfig/conf --allnoconfig Kconfig # # configuration written to .config # scripts/kconfig/Makefile:122: *** You need an existing .config for this target. Stop. make: *** [tinyconfig] Error 2 As shown above, "allnoconfig" has created the .config file before mergeconfig is called, but Make still raises a false alarm because of some sort of race condition. We can fix this issue by moving the error check to the shell script. Anyway, scripts/kconfig/merge_config.sh always requires an existing .config as a base file. It is reasonable to check its existence in the shell script. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
-rw-r--r--scripts/kconfig/Makefile1
-rwxr-xr-xscripts/kconfig/merge_config.sh5
2 files changed, 5 insertions, 1 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index fc34f46cb025..be0fad44ddd8 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -107,7 +107,6 @@ endif
107configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config) 107configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config)
108 108
109define mergeconfig 109define mergeconfig
110$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
111$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture)) 110$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture))
112$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1)) 111$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1))
113+$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig 112+$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 2118af84e661..88d89b2986db 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -85,6 +85,11 @@ fi
85INITFILE=$1 85INITFILE=$1
86shift; 86shift;
87 87
88if [ ! -r "$INITFILE" ]; then
89 echo "The base file '$INITFILE' does not exist. Exit." >&2
90 exit 1
91fi
92
88MERGE_LIST=$* 93MERGE_LIST=$*
89SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p" 94SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
90TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) 95TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)