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.
This commit is contained in:
Ivan Grokhotkov 2016-08-23 16:18:36 +08:00
parent 553b08cd5e
commit f19ac2b927
2 changed files with 11 additions and 2 deletions

View 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"

View 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