summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--Makefile.test50
-rw-r--r--Rules.make8
2 files changed, 40 insertions, 18 deletions
diff --git a/Makefile.test b/Makefile.test
index 3311cde..b30b85d 100644
--- a/Makefile.test
+++ b/Makefile.test
@@ -7,3 +7,16 @@ export QMAKESPEC=$(QMAKESPECSDIR)/qws/linux-generic-g++
-all :
+# $(TOPDIR)/.config depends on .depends.cfgs, as it depends on $(configs)
+# in order to have a full set of config.in files.
+# .depends depends on $(TOPDIR)/.config
+# everything else depends on .depends, to ensure the dependencies are
+# intact.
+#
+# NOTE: The order in which things happen in this makefile is
+# -critical-. Do not rearrange this!
+
+all : $(TOPDIR)/.config
+
+$(TOPDIR)/.config : $(TOPDIR)/.depends.cfgs
+
+all menuconfig xconfig oldconfig config randconfig allyesconfig allnoconfig defconfig : $(TOPDIR)/.depends
@@ -13,9 +26,7 @@ clean-configs : $(TOPDIR)/.depends
--include $(TOPDIR)/.config
--include $(TOPDIR)/..config.cmd
--include $(TOPDIR)/.depends
+-include $(TOPDIR)/.depends.cfgs
-all : $(TOPDIR)/.depends $(configs) $(subdir-y)
+all menuconfig xconfig oldconfig config randconfig allyesconfig allnoconfig defconfig : $(configs)
-./.config: $(configs)
+$(TOPDIR)/.config: $(TOPDIR)/.depends.cfgs $(configs)
$(call descend,scripts/kconfig,conf)
@@ -27,3 +38,7 @@ all : $(TOPDIR)/.depends $(configs) $(subdir-y)
-xconfig: $(configs)
+# config rules must have the $(configs) var defined
+# at the time that they run. we must ensure that .depends.cfgs
+# is built and included by the time we reach this point.
+
+xconfig :
$(call descend,scripts/kconfig,qconf)
@@ -31,3 +46,3 @@ xconfig: $(configs)
-menuconfig: $(configs) scripts/lxdialog/lxdialog
+menuconfig : scripts/lxdialog/lxdialog
$(call descend,scripts/kconfig,mconf)
@@ -35,3 +50,3 @@ menuconfig: $(configs) scripts/lxdialog/lxdialog
-config: $(configs)
+config :
$(call descend,scripts/kconfig,conf)
@@ -39,3 +54,3 @@ config: $(configs)
-oldconfig: $(configs)
+oldconfig :
$(call descend,scripts/kconfig,conf)
@@ -43,3 +58,3 @@ oldconfig: $(configs)
-randconfig: $(configs)
+randconfig :
$(call descend,scripts/kconfig,conf)
@@ -47,3 +62,3 @@ randconfig: $(configs)
-allyesconfig: $(configs)
+allyesconfig :
$(call descend,scripts/kconfig,conf)
@@ -51,3 +66,3 @@ allyesconfig: $(configs)
-allnoconfig: $(configs)
+allnoconfig :
$(call descend,scripts/kconfig,conf)
@@ -55,3 +70,3 @@ allnoconfig: $(configs)
-defconfig: $(configs)
+defconfig :
$(call descend,scripts/kconfig,conf)
@@ -60,3 +75,8 @@ defconfig: $(configs)
-include $(TOPDIR)/Rules.make
+-include $(TOPDIR)/.config
+-include $(TOPDIR)/..config.cmd
+-include $(TOPDIR)/.depends
+
+all : $(subdir-y)
+include $(TOPDIR)/Rules.make
diff --git a/Rules.make b/Rules.make
index 74e74fd..5943b93 100644
--- a/Rules.make
+++ b/Rules.make
@@ -5,3 +5,3 @@ $(configs) :
-$(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;)
+$(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config
@echo Generating dependency information...
@@ -19,6 +19,8 @@ $(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)
$(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends
+
+$(TOPDIR)/.depends.cfgs:
# generation of config.in files, and config.in interdependencies
@find $(TOPDIR)/ -name config.in | ( for cfg in `cat`; do dir=`dirname $$cfg`; name=`basename $$dir`; if [ ! -e $$dir/$$name.pro ]; then echo $$dir; fi; done; ) > dirs
- @echo "configs += `echo \`cat dirs | sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g' -e's,$$,/config.in,g'\``" >> .depends
- @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $(TOPDIR)/.depends
+ @echo "configs += `echo \`cat dirs | sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g' -e's,$$,/config.in,g'\``" >> $@
+ @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $@
@-rm -f dirs