mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 00:09:46 +01:00
buildsystem: split default modules include early and late
DEFAULT_MODULEs declared in defaultmodules_regular.inc.mk MAY only be disabled at APPLICATION level or in BOARD/CPU Makefile.default. These modules MAY have complex dependencies themselfs. DEFAULT_MODULEs declared in defaultmodules_no_recursive_deps.inc.mk MAY be disabled during dependency resolution. The MUST only have dependencies against modules with no dependencies themselfs, and these dependencies must be defined in makefiles/defaultmodules._deps.inc.mk
This commit is contained in:
parent
6cca6234b0
commit
b5197db03f
@ -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
|
||||
|
16
makefiles/defaultmodules_no_recursive_deps.inc.mk
Normal file
16
makefiles/defaultmodules_no_recursive_deps.inc.mk
Normal file
@ -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
|
@ -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 \
|
@ -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))
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user