From 84588069df12dba19e372777bf7aacdca0aa4646 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 19 Oct 2008 09:34:32 +0000 Subject: Avoid (re)building the kconfig dependencies when we don't need them (clean, build, list-steps...). /trunk/kconfig/kconfig.mk | 24 20 4 0 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index 38a3470..684146b 100644 --- a/kconfig/kconfig.mk +++ b/kconfig/kconfig.mk @@ -14,17 +14,20 @@ obj = kconfig #----------------------------------------------------------- # The configurators rules -PHONY += oldconfig menuconfig defoldconfig +configurators = menuconfig oldconfig defoldconfig +PHONY += $(configurators) -menuconfig: $(obj)/mconf config_files +$(configurators): config_files + +menuconfig: $(obj)/mconf @$(ECHO) " MCONF $(KCONFIG_TOP)" $(SILENT)$< $(KCONFIG_TOP) -oldconfig: $(obj)/conf .config config_files +oldconfig: $(obj)/conf .config @$(ECHO) " CONF $(KCONFIG_TOP)" $(SILENT)$< -s $(KCONFIG_TOP) -defoldconfig: $(obj)/conf .config config_files +defoldconfig: $(obj)/conf .config @$(ECHO) " CONF $(KCONFIG_TOP)" $(SILENT)yes "" |$< -s $(KCONFIG_TOP) @@ -68,8 +71,21 @@ mconf_OBJ = $(patsubst %.c,%.o,$(mconf_SRC)) # Cheesy auto-dependencies DEPS = $(patsubst %.c,%.dep,$(sort $(conf_SRC) $(mconf_SRC))) + +# Only parse the following if a configurator was called, to avoid building +# dependencies when not needed (eg. list-steps, list-samples...) +# We must be carefull what we enclose, because we need some of the variable +# definitions for clean (and distclean) at least. +# Just protecting the "-include $(DEPS)" line should be sufficient. + +ifneq ($(strip $(MAKECMDGOALS)),) +ifneq ($(strip $(filter $(configurators),$(MAKECMDGOALS))),) + -include $(DEPS) +endif # MAKECMDGOALS contains a configurator rule +endif # MAKECMDGOALS != "" + # This is not very nice, as they will get rebuild even if (dist)cleaning... :-( # Should look into the Linux kernel Kbuild to see how they do that... # To really make me look into this, keep the annoying "DEP xxx" messages. -- cgit v0.10.2-6-g49f6