]> granicus.if.org Git - esp-idf/commitdiff
build system: Probable fix for errors due to bad config bypassing components
authorAngus Gratton <angus@espressif.com>
Fri, 3 Feb 2017 05:02:22 +0000 (16:02 +1100)
committerAngus Gratton <angus@espressif.com>
Wed, 22 Feb 2017 00:58:49 +0000 (11:58 +1100)
See github #311 https://github.com/espressif/esp-idf/issues/311

Should fix weird compiler/linker bugs where config says something is
enabled, but build system says it is disabled.
Particularly noticeable when WiFi/BT libraries fail to
compile/link despite being enabled.

Underlying cause is configuration file regenerating, but component
Makefiles not reevaluating.

Entirely removes the idea that we don't need to generate config for some
targets (like 'clean'). We need valid config for these targets,
otherwise they don't know which files to clean (etc).

make/common.mk
make/project.mk
make/project_config.mk

index 605b8ab862916a16cd34310fb0496aa83c273f88..d19f7eb46c743453f24c3aab5c6308cec4269bce 100644 (file)
@@ -6,8 +6,8 @@
 #
 # (Note that we only rebuild this makefile automatically for some
 # targets, see project_config.mk for details.)
-SDKCONFIG_MAKEFILE ?= $(abspath $(BUILD_DIR_BASE)/include/config/auto.conf)
--include $(SDKCONFIG_MAKEFILE)
+SDKCONFIG_MAKEFILE ?= $(BUILD_DIR_BASE)/include/config/auto.conf
+include $(SDKCONFIG_MAKEFILE)
 export SDKCONFIG_MAKEFILE  # sub-makes (like bootloader) will reuse this path
 
 #Handling of V=1/VERBOSE=1 flag
index bebb1fc7d4478167001296b23bf2fbafcdec74f3..02ef7bb174e2fad912a8f7539011ef0b9b7b95dc 100644 (file)
@@ -370,12 +370,7 @@ $(BUILD_DIR_BASE)/$(2)/lib$(2).a: $(2)-build
 # If any component_project_vars.mk file is out of date, the make
 # process will call this target to rebuild it and then restart.
 #
-# Note: $(SDKCONFIG) is a normal prereq as we need to rebuild these
-# files whenever the config changes. $(SDKCONFIG_MAKEFILE) is an
-# order-only prereq because if it hasn't been rebuilt, we need to
-# build it first - but including it as a normal prereq can lead to
-# infinite restarts as the conf process will keep updating it.
-$(BUILD_DIR_BASE)/$(2)/component_project_vars.mk: $(1)/component.mk $(COMMON_MAKEFILES) $(SDKCONFIG) | $(BUILD_DIR_BASE)/$(2) $(SDKCONFIG_MAKEFILE)
+$(BUILD_DIR_BASE)/$(2)/component_project_vars.mk: $(1)/component.mk $(COMMON_MAKEFILES) $(SDKCONFIG_MAKEFILE) | $(BUILD_DIR_BASE)/$(2)
        $(call ComponentMake,$(1),$(2)) component_project_vars.mk
 endef
 
index 011aa1ff0e484d94632d4f1f3a7ca45e35e6f8da..d33ae11969772715619b8fa1bf06196aec3a2516 100644 (file)
@@ -48,26 +48,11 @@ endif
        mkdir -p $(BUILD_DIR_BASE)/include/config
        $(KCONFIG_TOOL_ENV) $(KCONFIG_TOOL_DIR)/conf --olddefconfig $(IDF_PATH)/Kconfig
 
-# Work out of whether we have to build the Kconfig makefile
-# (auto.conf), or if we're in a situation where we don't need it
-NON_CONFIG_TARGETS := clean %-clean help menuconfig defconfig
-AUTO_CONF_REGEN_TARGET := $(SDKCONFIG_MAKEFILE)
-
-# disable AUTO_CONF_REGEN_TARGET if all targets are non-config targets
-# (and not building default target)
-ifneq ("$(MAKECMDGOALS)","")
-ifeq ($(filter $(NON_CONFIG_TARGETS), $(MAKECMDGOALS)),$(MAKECMDGOALS))
-AUTO_CONF_REGEN_TARGET :=
-# dummy target
-$(SDKCONFIG_MAKEFILE):
-endif
-endif
-
-$(AUTO_CONF_REGEN_TARGET) $(BUILD_DIR_BASE)/include/sdkconfig.h: $(SDKCONFIG) $(KCONFIG_TOOL_DIR)/conf $(COMPONENT_KCONFIGS) $(COMPONENT_KCONFIGS_PROJBUILD)
+$(SDKCONFIG_MAKEFILE) $(BUILD_DIR_BASE)/include/sdkconfig.h: $(SDKCONFIG) $(KCONFIG_TOOL_DIR)/conf $(COMPONENT_KCONFIGS) $(COMPONENT_KCONFIGS_PROJBUILD)
        $(summary) GENCONFIG
        mkdir -p $(BUILD_DIR_BASE)/include/config
        cd $(BUILD_DIR_BASE); $(KCONFIG_TOOL_ENV) $(KCONFIG_TOOL_DIR)/conf --silentoldconfig $(IDF_PATH)/Kconfig
-       touch $(AUTO_CONF_REGEN_TARGET) $(BUILD_DIR_BASE)/include/sdkconfig.h
+       touch $(SDKCONFIG_MAKEFILE) $(BUILD_DIR_BASE)/include/sdkconfig.h
 # touch to ensure both output files are newer - as 'conf' can also update sdkconfig (a dependency). Without this,
 # sometimes you can get an infinite make loop on Windows where sdkconfig always gets regenerated newer
 # than the target(!)