mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 10:03:50 +01:00
Merge pull request #17632 from fjmolinas/pr_default_modules_deps
makefiles/dependency_resolution: add outer loop for DEFAULT_MODULE deps
This commit is contained in:
commit
e126743229
11
makefiles/default_modules.deps.mk
Normal file
11
makefiles/default_modules.deps.mk
Normal file
@ -0,0 +1,11 @@
|
||||
# This files contains dependencies for default modules. They are parsed at the
|
||||
# end of the dependency loop. They MAY inlcude new modules, but this modules
|
||||
# MUST NOT have dependencies themselfs.
|
||||
|
||||
ifneq (,$(filter auto_init_ztimer,$(USEMODULE)))
|
||||
USEMODULE += ztimer_init
|
||||
endif
|
||||
|
||||
ifneq (,$(filter auto_init_saul,$(USEMODULE)))
|
||||
USEMODULE += saul_init_devs
|
||||
endif
|
||||
@ -1,10 +1,5 @@
|
||||
DEFAULT_MODULE += board cpu core core_init core_msg core_panic sys
|
||||
|
||||
DEFAULT_MODULE += auto_init
|
||||
|
||||
# Initialize all used peripherals by default
|
||||
DEFAULT_MODULE += periph_init
|
||||
|
||||
# Include potentially added default modules by the board
|
||||
-include $(BOARDDIR)/Makefile.default
|
||||
|
||||
|
||||
@ -35,15 +35,27 @@ 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
|
||||
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
|
||||
|
||||
# add default modules again, as $(DEFAULT_MODULE) might have been extended
|
||||
# during dependency processing
|
||||
# If module periph_init is not used, silently disable all of its submodules
|
||||
ifeq (,$(filter periph_init,$(USEMODULE)))
|
||||
DISABLE_MODULE += periph_init_%
|
||||
endif
|
||||
|
||||
# Add default modules again, as $(DEFAULT_MODULE) might have been extended
|
||||
# during dependency resolution
|
||||
USEMODULE += $(filter-out $(DISABLE_MODULE),$(DEFAULT_MODULE))
|
||||
|
||||
# Include eventual dependencies for default modules
|
||||
include $(RIOTMAKE)/default_modules.deps.mk
|
||||
|
||||
# Sort and de-duplicate used modules and default modules for readability
|
||||
USEMODULE := $(sort $(USEMODULE))
|
||||
DEFAULT_MODULE := $(sort $(DEFAULT_MODULE))
|
||||
|
||||
@ -10,32 +10,30 @@ PERIPH_FEATURES := $(filter periph_%,$(FEATURES_USED))
|
||||
USEMODULE += $(PERIPH_FEATURES)
|
||||
|
||||
# Add all USED periph_% init modules unless they are blacklisted
|
||||
ifneq (,$(filter periph_init, $(USEMODULE)))
|
||||
PERIPH_IGNORE_MODULES := \
|
||||
periph_init% \
|
||||
periph_common \
|
||||
periph_flexcomm \
|
||||
periph_gpio_mux \
|
||||
periph_i2c_hw \
|
||||
periph_i2c_sw \
|
||||
periph_rtc_ms \
|
||||
periph_mcg \
|
||||
periph_wdog \
|
||||
periph_flash \
|
||||
periph_rtc_rtt \
|
||||
periph_rtt_hw_rtc \
|
||||
periph_rtt_hw_sys \
|
||||
periph_clic \
|
||||
periph_coretimer \
|
||||
periph_plic \
|
||||
periph_spi_on_qspi
|
||||
#
|
||||
PERIPH_MODULES := $(filter-out $(PERIPH_IGNORE_MODULES),\
|
||||
$(filter periph_%,$(USEMODULE)))
|
||||
# Use simple expansion to avoid USEMODULE referencing itself
|
||||
PERIPH_INIT_MODULES := $(subst periph_,periph_init_,$(PERIPH_MODULES))
|
||||
DEFAULT_MODULE += $(PERIPH_INIT_MODULES)
|
||||
endif
|
||||
PERIPH_IGNORE_MODULES := \
|
||||
periph_init% \
|
||||
periph_common \
|
||||
periph_flexcomm \
|
||||
periph_gpio_mux \
|
||||
periph_i2c_hw \
|
||||
periph_i2c_sw \
|
||||
periph_rtc_ms \
|
||||
periph_mcg \
|
||||
periph_wdog \
|
||||
periph_flash \
|
||||
periph_rtc_rtt \
|
||||
periph_rtt_hw_rtc \
|
||||
periph_rtt_hw_sys \
|
||||
periph_clic \
|
||||
periph_coretimer \
|
||||
periph_plic \
|
||||
periph_spi_on_qspi
|
||||
#
|
||||
PERIPH_MODULES := $(filter-out $(PERIPH_IGNORE_MODULES),\
|
||||
$(filter periph_%,$(USEMODULE)))
|
||||
# Use simple expansion to avoid USEMODULE referencing itself
|
||||
PERIPH_INIT_MODULES := $(subst periph_,periph_init_,$(PERIPH_MODULES))
|
||||
DEFAULT_MODULE += $(PERIPH_INIT_MODULES)
|
||||
|
||||
# select cpu_check_address pseudomodule if the corresponding feature is used
|
||||
USEMODULE += $(filter cpu_check_address, $(FEATURES_USED))
|
||||
|
||||
@ -88,10 +88,6 @@ ifneq (,$(filter base64url,$(USEMODULE)))
|
||||
USEMODULE += base64
|
||||
endif
|
||||
|
||||
ifneq (,$(filter auto_init_saul,$(USEMODULE)))
|
||||
USEMODULE += saul_init_devs
|
||||
endif
|
||||
|
||||
ifneq (,$(filter csma_sender,$(USEMODULE)))
|
||||
USEMODULE += random
|
||||
USEMODULE += xtimer
|
||||
@ -115,15 +111,12 @@ ifneq (,$(filter dhcpv6_client,$(USEMODULE)))
|
||||
endif
|
||||
|
||||
ifneq (,$(filter dhcpv6_relay,$(USEMODULE)))
|
||||
DEFAULT_MODULE += auto_init_dhcpv6_relay
|
||||
USEMODULE += event
|
||||
USEMODULE += sock_async_event
|
||||
USEMODULE += sock_udp
|
||||
endif
|
||||
|
||||
ifneq (,$(filter auto_init_dhcpv6_relay,$(USEMODULE)))
|
||||
USEMODULE += dhcpv6_relay
|
||||
endif
|
||||
|
||||
ifneq (,$(filter dns_%,$(USEMODULE)))
|
||||
USEMODULE += dns
|
||||
endif
|
||||
|
||||
@ -7,9 +7,6 @@ ifneq (,$(filter ztimer,$(USEMODULE)))
|
||||
USEMODULE += ztimer_core
|
||||
USEMODULE += ztimer_convert_frac
|
||||
USEMODULE += ztimer_convert_shift
|
||||
ifneq (,$(filter auto_init_ztimer,$(USEMODULE)))
|
||||
USEMODULE += ztimer_init
|
||||
endif
|
||||
DEFAULT_MODULE += auto_init_ztimer
|
||||
DEFAULT_MODULE += ztimer_init
|
||||
endif
|
||||
|
||||
@ -4,7 +4,7 @@ RIOTBASE ?= $(CURDIR)/../..
|
||||
|
||||
export TAP ?= tap0
|
||||
|
||||
USEMODULE += auto_init_dhcpv6_relay
|
||||
USEMODULE += dhcpv6_relay
|
||||
USEMODULE += event_thread
|
||||
USEMODULE += gnrc_ipv6_default
|
||||
USEMODULE += gnrc_netif_single # Only one interface used and it makes
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user