Menuconfig: Don't ask to save configuration when nothing has changed
Closes https://github.com/espressif/esp-idf/issues/4303
This commit is contained in:
parent
e3f0854771
commit
97488fe806
|
@ -29,7 +29,7 @@ SDKCONFIG_DEFAULTS ?= $(PROJECT_PATH)/sdkconfig.defaults
|
||||||
$(KCONFIG_TOOL_DIR)/mconf-idf: $(KCONFIG_TOOL_DIR)/conf-idf
|
$(KCONFIG_TOOL_DIR)/mconf-idf: $(KCONFIG_TOOL_DIR)/conf-idf
|
||||||
|
|
||||||
# reset MAKEFLAGS as the menuconfig makefile uses implicit compile rules
|
# reset MAKEFLAGS as the menuconfig makefile uses implicit compile rules
|
||||||
$(KCONFIG_TOOL_DIR)/mconf-idf $(KCONFIG_TOOL_DIR)/conf-idf: $(wildcard $(KCONFIG_TOOL_DIR)/*.c)
|
$(KCONFIG_TOOL_DIR)/mconf-idf $(KCONFIG_TOOL_DIR)/conf-idf: $(wildcard $(KCONFIG_TOOL_DIR)/*.c) $(wildcard $(KCONFIG_TOOL_DIR)/*.y)
|
||||||
MAKEFLAGS="" CC=$(HOSTCC) LD=$(HOSTLD) \
|
MAKEFLAGS="" CC=$(HOSTCC) LD=$(HOSTLD) \
|
||||||
$(MAKE) -C $(KCONFIG_TOOL_DIR)
|
$(MAKE) -C $(KCONFIG_TOOL_DIR)
|
||||||
|
|
||||||
|
@ -70,7 +70,8 @@ define RunConfGen
|
||||||
$(DEFAULTS_ARG) \
|
$(DEFAULTS_ARG) \
|
||||||
--output config ${SDKCONFIG} \
|
--output config ${SDKCONFIG} \
|
||||||
--output makefile $(SDKCONFIG_MAKEFILE) \
|
--output makefile $(SDKCONFIG_MAKEFILE) \
|
||||||
--output header $(BUILD_DIR_BASE)/include/sdkconfig.h
|
--output header $(BUILD_DIR_BASE)/include/sdkconfig.h \
|
||||||
|
$1
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# macro for the commands to run kconfig tools conf-idf or mconf-idf.
|
# macro for the commands to run kconfig tools conf-idf or mconf-idf.
|
||||||
|
@ -107,23 +108,23 @@ ifdef BATCH_BUILD
|
||||||
@echo "See esp-idf documentation for more details."
|
@echo "See esp-idf documentation for more details."
|
||||||
@exit 1
|
@exit 1
|
||||||
else
|
else
|
||||||
$(call RunConfGen)
|
$(call RunConfGen,--dont-write-deprecated)
|
||||||
# RunConfGen before mconf-idf ensures that deprecated options won't be ignored (they've got renamed)
|
# RunConfGen before menuconfig ensures that deprecated options won't be ignored (they've got renamed)
|
||||||
$(call RunConf,mconf-idf)
|
$(call RunConf,mconf-idf)
|
||||||
# RunConfGen after mconf-idf ensures that deprecated options are appended to $(SDKCONFIG) for backward compatibility
|
# RunConfGen after menuconfig ensures that deprecated options are appended to $(SDKCONFIG) for backward compatibility
|
||||||
$(call RunConfGen)
|
$(call RunConfGen,)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# defconfig creates a default config, based on SDKCONFIG_DEFAULTS if present
|
# defconfig creates a default config, based on SDKCONFIG_DEFAULTS if present
|
||||||
defconfig: | check_python_dependencies
|
defconfig: | check_python_dependencies
|
||||||
$(summary) DEFCONFIG
|
$(summary) DEFCONFIG
|
||||||
$(call RunConfGen)
|
$(call RunConfGen,)
|
||||||
|
|
||||||
# if neither defconfig or menuconfig are requested, use the GENCONFIG rule to
|
# if neither defconfig or menuconfig are requested, use the GENCONFIG rule to
|
||||||
# ensure generated config files are up to date
|
# ensure generated config files are up to date
|
||||||
$(SDKCONFIG_MAKEFILE) $(BUILD_DIR_BASE)/include/sdkconfig.h: $(SDKCONFIG) $(COMPONENT_KCONFIGS) $(COMPONENT_KCONFIGS_PROJBUILD) | check_python_dependencies $(call prereq_if_explicit,defconfig) $(call prereq_if_explicit,menuconfig)
|
$(SDKCONFIG_MAKEFILE) $(BUILD_DIR_BASE)/include/sdkconfig.h: $(SDKCONFIG) $(COMPONENT_KCONFIGS) $(COMPONENT_KCONFIGS_PROJBUILD) | check_python_dependencies $(call prereq_if_explicit,defconfig) $(call prereq_if_explicit,menuconfig)
|
||||||
$(summary) GENCONFIG
|
$(summary) GENCONFIG
|
||||||
$(call RunConfGen)
|
$(call RunConfGen,)
|
||||||
touch $(SDKCONFIG_MAKEFILE) $(BUILD_DIR_BASE)/include/sdkconfig.h # ensure newer than sdkconfig
|
touch $(SDKCONFIG_MAKEFILE) $(BUILD_DIR_BASE)/include/sdkconfig.h # ensure newer than sdkconfig
|
||||||
|
|
||||||
else # "$(MAKE_RESTARTS)" != ""
|
else # "$(MAKE_RESTARTS)" != ""
|
||||||
|
|
|
@ -240,7 +240,10 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
|
||||||
add_custom_target(menuconfig
|
add_custom_target(menuconfig
|
||||||
${menuconfig_depends}
|
${menuconfig_depends}
|
||||||
# create any missing config file, with defaults if necessary
|
# create any missing config file, with defaults if necessary
|
||||||
COMMAND ${confgen_basecommand} --env "IDF_TARGET=${idf_target}" --output config ${sdkconfig}
|
COMMAND ${confgen_basecommand}
|
||||||
|
--env "IDF_TARGET=${idf_target}"
|
||||||
|
--dont-write-deprecated
|
||||||
|
--output config ${sdkconfig}
|
||||||
COMMAND ${CMAKE_COMMAND} -E env
|
COMMAND ${CMAKE_COMMAND} -E env
|
||||||
"COMPONENT_KCONFIGS=${kconfigs}"
|
"COMPONENT_KCONFIGS=${kconfigs}"
|
||||||
"COMPONENT_KCONFIGS_PROJBUILD=${kconfig_projbuilds}"
|
"COMPONENT_KCONFIGS_PROJBUILD=${kconfig_projbuilds}"
|
||||||
|
|
|
@ -311,7 +311,7 @@ ifeq ($(MAKECMDGOALS),gconfig)
|
||||||
fi
|
fi
|
||||||
endif
|
endif
|
||||||
|
|
||||||
zconf.tab.o: zconf.lex.c zconf.hash.c
|
zconf.tab.o: zconf.lex.c zconf.hash.c zconf.tab.c
|
||||||
|
|
||||||
qconf.o: qconf.moc
|
qconf.o: qconf.moc
|
||||||
|
|
||||||
|
|
|
@ -1042,6 +1042,8 @@ int main(int ac, char **av)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sym_set_change_count(0);
|
||||||
|
|
||||||
set_config_filename(conf_get_configname());
|
set_config_filename(conf_get_configname());
|
||||||
conf_set_message_callback(conf_message_callback);
|
conf_set_message_callback(conf_message_callback);
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -191,6 +191,10 @@ def main():
|
||||||
help='File with deprecated Kconfig options',
|
help='File with deprecated Kconfig options',
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
|
parser.add_argument('--dont-write-deprecated',
|
||||||
|
help='Do not write compatibility statements for deprecated values',
|
||||||
|
action='store_true')
|
||||||
|
|
||||||
parser.add_argument('--output', nargs=2, action='append',
|
parser.add_argument('--output', nargs=2, action='append',
|
||||||
help='Write output file (format and output filename)',
|
help='Write output file (format and output filename)',
|
||||||
metavar=('FORMAT', 'FILENAME'),
|
metavar=('FORMAT', 'FILENAME'),
|
||||||
|
@ -264,6 +268,11 @@ def main():
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if args.dont_write_deprecated:
|
||||||
|
# The deprecated object was useful until now for replacements. Now it will be redefined with no configurations
|
||||||
|
# and as the consequence, it won't generate output with deprecated statements.
|
||||||
|
deprecated_options = DeprecatedOptions('', path_rename_files=[])
|
||||||
|
|
||||||
# Output the files specified in the arguments
|
# Output the files specified in the arguments
|
||||||
for output_type, filename in args.output:
|
for output_type, filename in args.output:
|
||||||
with tempfile.NamedTemporaryFile(prefix="confgen_tmp", delete=False) as f:
|
with tempfile.NamedTemporaryFile(prefix="confgen_tmp", delete=False) as f:
|
||||||
|
|
Loading…
Reference in a new issue