]> granicus.if.org Git - esp-idf/commitdiff
make: add defconfig, don't run silentoldconfig before menuconfig
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 23 Aug 2016 08:18:36 +0000 (16:18 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Tue, 23 Aug 2016 08:18:36 +0000 (16:18 +0800)
This commit fixes the case when new Kconfig configuration options were added and you run `make menuconfig`.
Previously this would first show console prompt to set values for new options, and then launch menuconfig.
Now this will just launch menuconfig.
New target is added, defconfig, which may be useful for non-interactive environments to set default values for
all new configuration options.

make/project.mk
make/project_config.mk

index bfc9a2f7f6b025f2427423e52c5012461b9bbb72..99fa1c1a15b11302c65a15922be092cbacc3dfcb 100644 (file)
@@ -10,7 +10,7 @@
 # Makefile is located.
 #
 
-.PHONY: build-components menuconfig all build clean all_binaries
+.PHONY: build-components menuconfig defconfig all build clean all_binaries
 all: all_binaries # other components will add dependencies to 'all_binaries'
        @echo "To flash all build output, run 'make flash' or:"
        @echo $(ESPTOOLPY_WRITE_FLASH) $(ESPTOOL_ALL_FLASH_ARGS)
@@ -23,6 +23,7 @@ help:
        @echo "Welcome to Espressif IDF build system. Some useful make targets:"
        @echo ""
        @echo "make menuconfig - Configure IDF project"
+       @echo "make defconfig - Set defaults for all new configuration options"
        @echo ""
        @echo "make all - Build app, bootloader, partition table"
        @echo "make flash - Flash all components to a fresh chip"
index b8808180c1f672324d5438d227e577f8faf356d6..c813ac5849d7349335e9f7b9cb485f9c060b045a 100644 (file)
@@ -28,10 +28,18 @@ ifeq ("$(wildcard $(PROJECT_PATH)/sdkconfig)","")
 $(PROJECT_PATH)/sdkconfig: menuconfig
 endif
 
+defconfig: $(KCONFIG_TOOL_DIR)/mconf $(IDF_PATH)/Kconfig $(BUILD_DIR_BASE)
+       $(vecho) DEFCONFIG
+       $(Q) mkdir -p $(PROJECT_PATH)/build/include/config
+       $(Q) KCONFIG_AUTOHEADER=$(PROJECT_PATH)/build/include/sdkconfig.h \
+       KCONFIG_CONFIG=$(PROJECT_PATH)/sdkconfig \
+       COMPONENT_KCONFIGS="$(COMPONENT_KCONFIGS)" \
+       COMPONENT_KCONFIGS_PROJBUILD="$(COMPONENT_KCONFIGS_PROJBUILD)" \
+       $(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 get_variable help
+NON_CONFIG_TARGETS := clean %-clean get_variable help menuconfig defconfig
 AUTO_CONF_REGEN_TARGET := $(PROJECT_PATH)/build/include/config/auto.conf
 
 # disable AUTO_CONF_REGEN_TARGET if all targets are non-config targets