diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-10-19 09:34:32 +0000 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-10-19 09:34:32 +0000 |
commit | 84588069df12dba19e372777bf7aacdca0aa4646 (patch) | |
tree | 0229c972cd4378ac1c4df69231783bbeb2f7a108 /kconfig/kconfig.mk | |
parent | 8d042db1d6dd99e8be345306ff3f9490f7636658 (diff) | |
download | crosstool-ng-84588069df12dba19e372777bf7aacdca0aa4646.tar.gz crosstool-ng-84588069df12dba19e372777bf7aacdca0aa4646.tar.bz2 crosstool-ng-84588069df12dba19e372777bf7aacdca0aa4646.zip |
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(-)
Diffstat (limited to 'kconfig/kconfig.mk')
-rw-r--r-- | kconfig/kconfig.mk | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index 38a3470c..684146b9 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. |