From 707ad8d0835d43456952a9c9bb90a8c24be17baf Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 6 Dec 2019 19:40:09 +0100 Subject: [PATCH] makefiles/kconfig: Include configuration symbols If the generated configuration file is present include it. That way one can check if certain symbols are being configured using Kconfig. --- makefiles/kconfig.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/makefiles/kconfig.mk b/makefiles/kconfig.mk index 59e1c4bfa7..360c56900c 100644 --- a/makefiles/kconfig.mk +++ b/makefiles/kconfig.mk @@ -36,6 +36,18 @@ KCONFIG_USER_CONFIG = $(APPDIR)/user.config # one that is used to generate the 'riotconf.h' header KCONFIG_MERGED_CONFIG = $(GENERATED_DIR)/merged.config +# Include configuration symbols if available, only when not cleaning. This +# allows to check for Kconfig symbols in makefiles. +# Make tries to 'remake' all included files +# (see https://www.gnu.org/software/make/manual/html_node/Remaking-Makefiles.html). +# So if this file was included even when 'clean' is called, make would enter a +# loop, as it always is out-of-date. +# This has the side effect of requiring a Kconfig user to run 'clean' on a +# separate call (e.g. 'make clean && make all'), to get the symbols correctly. +ifneq ($(CLEAN),clean) + -include $(KCONFIG_MERGED_CONFIG) +endif + # Flag that indicates that the configuration has been edited KCONFIG_EDITED_CONFIG = $(GENERATED_DIR)/.editedconfig