summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2006-06-08 22:12:39 -0700
committerSam Ravnborg <sam@mars.ravnborg.org>2006-06-09 07:31:30 +0200
commitc955ccafc38e77312b4c65e5a70960080fb8a3f2 (patch)
treef630610edef42b8ed60c455cfdb74d897190f1d3 /Makefile
parentddc97cacb310ad68483952e67764c4153c138ed2 (diff)
downloadop-kernel-dev-c955ccafc38e77312b4c65e5a70960080fb8a3f2.zip
op-kernel-dev-c955ccafc38e77312b4c65e5a70960080fb8a3f2.tar.gz
kconfig: fix .config dependencies
This fixes one of the worst kbuild warts left - the broken dependencies used to check and regenerate the .config file. This was done via an indirect dependency and the .config itself had an empty command, which can cause make not to reread the changed .config file. Instead of this we generate now a new file include/config/auto.conf from .config, which is used for kbuild and has the proper dependencies. It's also the main make target now for all files generated during this step (and thus replaces include/linux/autoconf.h). This also means we can now relax the syntax requirements for the .config file and we don't have to rewrite it all the time, i.e. silentoldconfig only writes .config now when it's necessary to keep it in sync with the Kconfig files and even this can be suppressed by setting the environment variable KCONFIG_NOSILENTUPDATE, so the update can (and must) be done manually. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 11 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index a3a7baa..b161056 100644
--- a/Makefile
+++ b/Makefile
@@ -404,7 +404,7 @@ include $(srctree)/arch/$(ARCH)/Makefile
export KBUILD_DEFCONFIG
config %config: scripts_basic outputmakefile FORCE
- $(Q)mkdir -p include/linux
+ $(Q)mkdir -p include/linux include/config
$(Q)$(MAKE) $(build)=scripts/kconfig $@
$(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
@@ -421,8 +421,6 @@ PHONY += scripts
scripts: scripts_basic include/config/MARKER
$(Q)$(MAKE) $(build)=$(@)
-scripts_basic: include/linux/autoconf.h
-
# Objects we will link into vmlinux / subdirs we need to visit
init-y := init/
drivers-y := drivers/ sound/
@@ -436,25 +434,22 @@ ifeq ($(dot-config),1)
# Read in dependencies to all Kconfig* files, make sure to run
# oldconfig if changes are detected.
--include .kconfig.d
-
-include .config
+-include include/config/auto.conf.cmd
+-include include/config/auto.conf
-# If .config needs to be updated, it will be done via the dependency
-# that autoconf has on .config.
# To avoid any implicit rule to kick in, define an empty command
-.config .kconfig.d: ;
+.config include/config/auto.conf.cmd: ;
-# If .config is newer than include/linux/autoconf.h, someone tinkered
+# If .config is newer than include/config/auto.conf, someone tinkered
# with it and forgot to run make oldconfig.
-# If kconfig.d is missing then we are probarly in a cleaned tree so
+# if auto.conf.cmd is missing then we are probarly in a cleaned tree so
# we execute the config step to be sure to catch updated Kconfig files
-include/linux/autoconf.h: .kconfig.d .config
- $(Q)mkdir -p include/linux
+include/config/auto.conf: .config include/config/auto.conf.cmd
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
+
else
# Dummy target needed, because used as prerequisite
-include/linux/autoconf.h: ;
+include/config/auto.conf: ;
endif
# The all: target is the default when no target is given on the
@@ -779,7 +774,7 @@ PHONY += prepare-all
prepare3: .kernelrelease
ifneq ($(KBUILD_SRC),)
@echo ' Using $(srctree) as source for kernel'
- $(Q)if [ -f $(srctree)/.config ]; then \
+ $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
echo " $(srctree) is not clean, please run 'make mrproper'";\
echo " in the '$(srctree)' directory.";\
/bin/false; \
@@ -822,7 +817,7 @@ include/asm:
# Split autoconf.h into include/linux/config/*
-include/config/MARKER: scripts/basic/split-include include/linux/autoconf.h
+include/config/MARKER: scripts/basic/split-include include/config/auto.conf
@echo ' SPLIT include/linux/autoconf.h -> include/config/*'
@scripts/basic/split-include include/linux/autoconf.h include/config
@touch $@
OpenPOWER on IntegriCloud