aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2006-06-09 01:12:39 -0400
committerSam Ravnborg <sam@mars.ravnborg.org>2006-06-09 01:31:30 -0400
commitc955ccafc38e77312b4c65e5a70960080fb8a3f2 (patch)
treef630610edef42b8ed60c455cfdb74d897190f1d3 /Makefile
parentddc97cacb310ad68483952e67764c4153c138ed2 (diff)
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 a3a7baad8555..b1610562a65f 100644
--- a/Makefile
+++ b/Makefile
@@ -404,7 +404,7 @@ include $(srctree)/arch/$(ARCH)/Makefile
404export KBUILD_DEFCONFIG 404export KBUILD_DEFCONFIG
405 405
406config %config: scripts_basic outputmakefile FORCE 406config %config: scripts_basic outputmakefile FORCE
407 $(Q)mkdir -p include/linux 407 $(Q)mkdir -p include/linux include/config
408 $(Q)$(MAKE) $(build)=scripts/kconfig $@ 408 $(Q)$(MAKE) $(build)=scripts/kconfig $@
409 $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease 409 $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
410 410
@@ -421,8 +421,6 @@ PHONY += scripts
421scripts: scripts_basic include/config/MARKER 421scripts: scripts_basic include/config/MARKER
422 $(Q)$(MAKE) $(build)=$(@) 422 $(Q)$(MAKE) $(build)=$(@)
423 423
424scripts_basic: include/linux/autoconf.h
425
426# Objects we will link into vmlinux / subdirs we need to visit 424# Objects we will link into vmlinux / subdirs we need to visit
427init-y := init/ 425init-y := init/
428drivers-y := drivers/ sound/ 426drivers-y := drivers/ sound/
@@ -436,25 +434,22 @@ ifeq ($(dot-config),1)
436 434
437# Read in dependencies to all Kconfig* files, make sure to run 435# Read in dependencies to all Kconfig* files, make sure to run
438# oldconfig if changes are detected. 436# oldconfig if changes are detected.
439-include .kconfig.d 437-include include/config/auto.conf.cmd
440 438-include include/config/auto.conf
441include .config
442 439
443# If .config needs to be updated, it will be done via the dependency
444# that autoconf has on .config.
445# To avoid any implicit rule to kick in, define an empty command 440# To avoid any implicit rule to kick in, define an empty command
446.config .kconfig.d: ; 441.config include/config/auto.conf.cmd: ;
447 442
448# If .config is newer than include/linux/autoconf.h, someone tinkered 443# If .config is newer than include/config/auto.conf, someone tinkered
449# with it and forgot to run make oldconfig. 444# with it and forgot to run make oldconfig.
450# If kconfig.d is missing then we are probarly in a cleaned tree so 445# if auto.conf.cmd is missing then we are probarly in a cleaned tree so
451# we execute the config step to be sure to catch updated Kconfig files 446# we execute the config step to be sure to catch updated Kconfig files
452include/linux/autoconf.h: .kconfig.d .config 447include/config/auto.conf: .config include/config/auto.conf.cmd
453 $(Q)mkdir -p include/linux
454 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig 448 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
449
455else 450else
456# Dummy target needed, because used as prerequisite 451# Dummy target needed, because used as prerequisite
457include/linux/autoconf.h: ; 452include/config/auto.conf: ;
458endif 453endif
459 454
460# The all: target is the default when no target is given on the 455# The all: target is the default when no target is given on the
@@ -779,7 +774,7 @@ PHONY += prepare-all
779prepare3: .kernelrelease 774prepare3: .kernelrelease
780ifneq ($(KBUILD_SRC),) 775ifneq ($(KBUILD_SRC),)
781 @echo ' Using $(srctree) as source for kernel' 776 @echo ' Using $(srctree) as source for kernel'
782 $(Q)if [ -f $(srctree)/.config ]; then \ 777 $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
783 echo " $(srctree) is not clean, please run 'make mrproper'";\ 778 echo " $(srctree) is not clean, please run 'make mrproper'";\
784 echo " in the '$(srctree)' directory.";\ 779 echo " in the '$(srctree)' directory.";\
785 /bin/false; \ 780 /bin/false; \
@@ -822,7 +817,7 @@ include/asm:
822 817
823# Split autoconf.h into include/linux/config/* 818# Split autoconf.h into include/linux/config/*
824 819
825include/config/MARKER: scripts/basic/split-include include/linux/autoconf.h 820include/config/MARKER: scripts/basic/split-include include/config/auto.conf
826 @echo ' SPLIT include/linux/autoconf.h -> include/config/*' 821 @echo ' SPLIT include/linux/autoconf.h -> include/config/*'
827 @scripts/basic/split-include include/linux/autoconf.h include/config 822 @scripts/basic/split-include include/linux/autoconf.h include/config
828 @touch $@ 823 @touch $@