diff --git a/Makefile.include b/Makefile.include index 3e73ed8f82..d8008fbcdd 100644 --- a/Makefile.include +++ b/Makefile.include @@ -425,7 +425,7 @@ endif # mandatory includes! include $(RIOTMAKE)/pseudomodules.inc.mk -include $(RIOTMAKE)/defaultmodules.inc.mk +include $(RIOTMAKE)/defaultmodules_regular.inc.mk # Include Kconfig functionalities include $(RIOTMAKE)/kconfig.mk diff --git a/makefiles/default_modules.deps.mk b/makefiles/defaultmodules_deps.inc.mk similarity index 100% rename from makefiles/default_modules.deps.mk rename to makefiles/defaultmodules_deps.inc.mk diff --git a/makefiles/defaultmodules_no_recursive_deps.inc.mk b/makefiles/defaultmodules_no_recursive_deps.inc.mk new file mode 100644 index 0000000000..0c464f2f72 --- /dev/null +++ b/makefiles/defaultmodules_no_recursive_deps.inc.mk @@ -0,0 +1,16 @@ +# This file declare DEFAULT_MODULEs that MAY only have as dependecies modules +# with no dependencies themselfs. If they modules declared here have dependencies +# they must be delcared in defaultmodules_deps.inc.mk. +# These DEFAULT_MODULEs MAY be disabled during dependency resolution + +DEFAULT_MODULE += auto_init periph_init + +DEFAULT_MODULE += periph_init_leds +DEFAULT_MODULE += periph_init_led0 +DEFAULT_MODULE += periph_init_led1 +DEFAULT_MODULE += periph_init_led2 +DEFAULT_MODULE += periph_init_led3 +DEFAULT_MODULE += periph_init_led4 +DEFAULT_MODULE += periph_init_led5 +DEFAULT_MODULE += periph_init_led6 +DEFAULT_MODULE += periph_init_led7 diff --git a/makefiles/defaultmodules.inc.mk b/makefiles/defaultmodules_regular.inc.mk similarity index 60% rename from makefiles/defaultmodules.inc.mk rename to makefiles/defaultmodules_regular.inc.mk index 1231427d31..5dc2fa6e9c 100644 --- a/makefiles/defaultmodules.inc.mk +++ b/makefiles/defaultmodules_regular.inc.mk @@ -1,3 +1,8 @@ +# This file declare DEFAULT_MODULEs that MAY have dependencies themselfs +# and where there dependencies MAY have dependencies as well. +# These DEFAULT_MODULEs MUST only be disabled at application level or +# in BOARD/CPU Makefile.default + DEFAULT_MODULE += board board_common_init \ cpu \ core core_init core_lib core_msg core_panic core_thread \ diff --git a/makefiles/dependency_resolution.inc.mk b/makefiles/dependency_resolution.inc.mk index b0264c07b4..7c33021e56 100644 --- a/makefiles/dependency_resolution.inc.mk +++ b/makefiles/dependency_resolution.inc.mk @@ -35,25 +35,15 @@ NEW_STATE := $(USEMODULE) $(USEPKG) $(FEATURES_USED) ifneq ($(OLD_STATE),$(NEW_STATE)) include $(RIOTMAKE)/dependency_resolution.inc.mk else - # Include late allowing them to have been disabled during dependency resolution - DEFAULT_MODULE += auto_init periph_init - DEFAULT_MODULE += periph_init_leds - DEFAULT_MODULE += periph_init_led0 - DEFAULT_MODULE += periph_init_led1 - DEFAULT_MODULE += periph_init_led2 - DEFAULT_MODULE += periph_init_led3 - DEFAULT_MODULE += periph_init_led4 - DEFAULT_MODULE += periph_init_led5 - DEFAULT_MODULE += periph_init_led6 - DEFAULT_MODULE += periph_init_led7 + include $(RIOTMAKE)/defaultmodules_no_recursive_deps.inc.mk + # Add auto_init and periph_init so that if not used all periph_init% and + # auto_init_% modules can be silently disabled USEMODULE += $(filter-out $(DISABLE_MODULE),auto_init periph_init) - # If module auto_init is not used, silently disable all of its submodules ifeq (,$(filter auto_init,$(USEMODULE))) DISABLE_MODULE += auto_init_% endif - # If module periph_init is not used, silently disable all of its submodules ifeq (,$(filter periph_init,$(USEMODULE))) DISABLE_MODULE += periph_init_% @@ -64,7 +54,7 @@ else USEMODULE += $(filter-out $(DISABLE_MODULE),$(DEFAULT_MODULE)) # Include eventual dependencies for default modules - include $(RIOTMAKE)/default_modules.deps.mk + include $(RIOTMAKE)/defaultmodules_deps.inc.mk # Sort and de-duplicate used modules and default modules for readability USEMODULE := $(sort $(USEMODULE)) diff --git a/makefiles/info-global.inc.mk b/makefiles/info-global.inc.mk index 68be99dab4..177a446c9c 100644 --- a/makefiles/info-global.inc.mk +++ b/makefiles/info-global.inc.mk @@ -64,7 +64,7 @@ define board_unsatisfied_features BOARDS_WITH_MISSING_FEATURES += $$(BOARD) else # add default modules - include $(RIOTMAKE)/defaultmodules.inc.mk + include $(RIOTMAKE)/defaultmodules_regular.inc.mk USEMODULE += $$(filter-out $$(DISABLE_MODULE),$$(DEFAULT_MODULE)) include $(RIOTMAKE)/dependency_resolution.inc.mk