From f19ac2b92794b3d17687ac94bc3f12d3f9d210e9 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 23 Aug 2016 16:18:36 +0800 Subject: [PATCH] make: add defconfig, don't run silentoldconfig before menuconfig 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 | 3 ++- make/project_config.mk | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/make/project.mk b/make/project.mk index bfc9a2f7f6..99fa1c1a15 100644 --- a/make/project.mk +++ b/make/project.mk @@ -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" diff --git a/make/project_config.mk b/make/project_config.mk index b8808180c1..c813ac5849 100644 --- a/make/project_config.mk +++ b/make/project_config.mk @@ -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 -- 2.40.0