diff --git a/Makefile.include b/Makefile.include index 7cd2c30512..3dd322e60b 100644 --- a/Makefile.include +++ b/Makefile.include @@ -217,9 +217,6 @@ ifeq (1,$(TEST_KCONFIG)) SHOULD_RUN_KCONFIG = 1 endif -# Include Kconfig functionalities -include $(RIOTMAKE)/kconfig.mk - ifeq ($(OS),Darwin) OPEN := open else @@ -366,6 +363,9 @@ include $(RIOTBASE)/Makefile.features include $(RIOTMAKE)/pseudomodules.inc.mk include $(RIOTMAKE)/defaultmodules.inc.mk +# Include Kconfig functionalities +include $(RIOTMAKE)/kconfig.mk + # For testing, use TEST_KCONFIG as a switch between Makefile.dep and Kconfig ifeq (1,$(TEST_KCONFIG)) $(info === [ATTENTION] Testing Kconfig dependency modelling ===) diff --git a/makefiles/kconfig.mk b/makefiles/kconfig.mk index 4c9b1c89f4..25b9040ac2 100644 --- a/makefiles/kconfig.mk +++ b/makefiles/kconfig.mk @@ -50,6 +50,13 @@ KCONFIG_OUT_DEP = $(KCONFIG_OUT_CONFIG).d # Add configurations to merge, in ascendent priority (i.e. a file overrides the # previous ones). +ifeq (1, $(TEST_KCONFIG)) + # KCONFIG_ADD_CONFIG holds a list of .config files that are merged for the + # initial configuration. This allows to split configurations in common files + # and share them among boards or cpus. + MERGE_SOURCES += $(KCONFIG_ADD_CONFIG) +endif + MERGE_SOURCES += $(wildcard $(KCONFIG_APP_CONFIG)) MERGE_SOURCES += $(wildcard $(KCONFIG_USER_CONFIG)) diff --git a/makefiles/vars.inc.mk b/makefiles/vars.inc.mk index 82c4386b25..f7fe9b101e 100644 --- a/makefiles/vars.inc.mk +++ b/makefiles/vars.inc.mk @@ -118,3 +118,4 @@ export LAZYSPONGE_FLAGS # Parameters supplied to LAZYSPONGE. export AFL_FLAGS # Additional command-line flags passed to afl during fuzzing. # LOG_LEVEL # Logging level as integer (NONE: 0, ERROR: 1, WARNING: 2, INFO: 3, DEBUG: 4, default: 3) +# KCONFIG_ADD_CONFIG # List of .config files to be merged used by Boards and CPUs. See kconfig.mk