1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

makefiles/kconfig.mk: force SHOULD_USE_KCONFIG if config file is present

Co-authored-by: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
This commit is contained in:
Jose Alamos 2021-07-14 01:08:21 +02:00
parent c2e9bc5c73
commit dc482cffff
No known key found for this signature in database
GPG Key ID: F483EB800EF89DD9

View File

@ -70,11 +70,14 @@ $(GENERATED_DIR): $(if $(MAKE_RESTARTS),,$(CLEAN))
# During migration this checks if Kconfig should run. It will run if any of
# the following is true:
# - A file with '.config' extension is present in the application directory
# - A 'Kconfig' file is present in the application directory
# - A previous configuration file is present (e.g. from a previous call to
# menuconfig)
# - menuconfig is being called
# - SHOULD_RUN_KCONFIG or TEST_KCONFIG is set
#
# By default SHOULD_RUN_KCONFIG is set if any of the following is true:
# - A file with '.config' extension is present in the application directory
# - A 'Kconfig' file is present in the application directory
#
# NOTE: This assumes that Kconfig will not generate any default configurations
# just from the Kconfig files outside the application folder (i.e. module
@ -82,13 +85,22 @@ $(GENERATED_DIR): $(if $(MAKE_RESTARTS),,$(CLEAN))
# check would not longer be valid, and Kconfig would have to run on every
# build.
SHOULD_RUN_KCONFIG ?= $(or $(wildcard $(APPDIR)/*.config), \
$(wildcard $(APPDIR)/Kconfig), \
$(if $(CLEAN),,$(wildcard $(KCONFIG_OUT_CONFIG))))
$(wildcard $(APPDIR)/Kconfig))
ifneq (,$(filter menuconfig, $(MAKECMDGOALS)))
SHOULD_RUN_KCONFIG := 1
endif
ifneq (,$(if $(CLEAN),,$(wildcard $(KCONFIG_OUT_CONFIG))))
ifeq (,$(SHOULD_RUN_KCONFIG))
WARNING_MSG := Warning! SHOULD_RUN_KCONFIG is not set but a previous \
configuration file was detected (did you run \
`make menuconfig`?). Kconfig will run regardless.
$(warning $(WARNING_MSG))
endif
SHOULD_RUN_KCONFIG := 1
endif
# When testing Kconfig we should always run it
ifeq (1,$(TEST_KCONFIG))
SHOULD_RUN_KCONFIG := 1