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(-)
This commit is contained in:
Yann E. MORIN" 2008-10-19 09:34:32 +00:00
parent 8d042db1d6
commit 84588069df

View File

@ -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.