1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-17 02:23:49 +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:
benpicco 2022-02-14 15:17:19 +01:00 committed by GitHub
commit e126743229
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 51 additions and 45 deletions

View 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

View File

@ -1,10 +1,5 @@
DEFAULT_MODULE += board cpu core core_init core_msg core_panic sys 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 potentially added default modules by the board
-include $(BOARDDIR)/Makefile.default -include $(BOARDDIR)/Makefile.default

View File

@ -35,15 +35,27 @@ NEW_STATE := $(USEMODULE) $(USEPKG) $(FEATURES_USED)
ifneq ($(OLD_STATE),$(NEW_STATE)) ifneq ($(OLD_STATE),$(NEW_STATE))
include $(RIOTMAKE)/dependency_resolution.inc.mk include $(RIOTMAKE)/dependency_resolution.inc.mk
else 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 # If module auto_init is not used, silently disable all of its submodules
ifeq (,$(filter auto_init,$(USEMODULE))) ifeq (,$(filter auto_init,$(USEMODULE)))
DISABLE_MODULE += auto_init_% DISABLE_MODULE += auto_init_%
endif endif
# add default modules again, as $(DEFAULT_MODULE) might have been extended # If module periph_init is not used, silently disable all of its submodules
# during dependency processing 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)) 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 # Sort and de-duplicate used modules and default modules for readability
USEMODULE := $(sort $(USEMODULE)) USEMODULE := $(sort $(USEMODULE))
DEFAULT_MODULE := $(sort $(DEFAULT_MODULE)) DEFAULT_MODULE := $(sort $(DEFAULT_MODULE))

View File

@ -10,7 +10,6 @@ PERIPH_FEATURES := $(filter periph_%,$(FEATURES_USED))
USEMODULE += $(PERIPH_FEATURES) USEMODULE += $(PERIPH_FEATURES)
# Add all USED periph_% init modules unless they are blacklisted # Add all USED periph_% init modules unless they are blacklisted
ifneq (,$(filter periph_init, $(USEMODULE)))
PERIPH_IGNORE_MODULES := \ PERIPH_IGNORE_MODULES := \
periph_init% \ periph_init% \
periph_common \ periph_common \
@ -35,7 +34,6 @@ ifneq (,$(filter periph_init, $(USEMODULE)))
# Use simple expansion to avoid USEMODULE referencing itself # Use simple expansion to avoid USEMODULE referencing itself
PERIPH_INIT_MODULES := $(subst periph_,periph_init_,$(PERIPH_MODULES)) PERIPH_INIT_MODULES := $(subst periph_,periph_init_,$(PERIPH_MODULES))
DEFAULT_MODULE += $(PERIPH_INIT_MODULES) DEFAULT_MODULE += $(PERIPH_INIT_MODULES)
endif
# select cpu_check_address pseudomodule if the corresponding feature is used # select cpu_check_address pseudomodule if the corresponding feature is used
USEMODULE += $(filter cpu_check_address, $(FEATURES_USED)) USEMODULE += $(filter cpu_check_address, $(FEATURES_USED))

View File

@ -88,10 +88,6 @@ ifneq (,$(filter base64url,$(USEMODULE)))
USEMODULE += base64 USEMODULE += base64
endif endif
ifneq (,$(filter auto_init_saul,$(USEMODULE)))
USEMODULE += saul_init_devs
endif
ifneq (,$(filter csma_sender,$(USEMODULE))) ifneq (,$(filter csma_sender,$(USEMODULE)))
USEMODULE += random USEMODULE += random
USEMODULE += xtimer USEMODULE += xtimer
@ -115,15 +111,12 @@ ifneq (,$(filter dhcpv6_client,$(USEMODULE)))
endif endif
ifneq (,$(filter dhcpv6_relay,$(USEMODULE))) ifneq (,$(filter dhcpv6_relay,$(USEMODULE)))
DEFAULT_MODULE += auto_init_dhcpv6_relay
USEMODULE += event USEMODULE += event
USEMODULE += sock_async_event USEMODULE += sock_async_event
USEMODULE += sock_udp USEMODULE += sock_udp
endif endif
ifneq (,$(filter auto_init_dhcpv6_relay,$(USEMODULE)))
USEMODULE += dhcpv6_relay
endif
ifneq (,$(filter dns_%,$(USEMODULE))) ifneq (,$(filter dns_%,$(USEMODULE)))
USEMODULE += dns USEMODULE += dns
endif endif

View File

@ -7,9 +7,6 @@ ifneq (,$(filter ztimer,$(USEMODULE)))
USEMODULE += ztimer_core USEMODULE += ztimer_core
USEMODULE += ztimer_convert_frac USEMODULE += ztimer_convert_frac
USEMODULE += ztimer_convert_shift USEMODULE += ztimer_convert_shift
ifneq (,$(filter auto_init_ztimer,$(USEMODULE)))
USEMODULE += ztimer_init
endif
DEFAULT_MODULE += auto_init_ztimer DEFAULT_MODULE += auto_init_ztimer
DEFAULT_MODULE += ztimer_init DEFAULT_MODULE += ztimer_init
endif endif

View File

@ -4,7 +4,7 @@ RIOTBASE ?= $(CURDIR)/../..
export TAP ?= tap0 export TAP ?= tap0
USEMODULE += auto_init_dhcpv6_relay USEMODULE += dhcpv6_relay
USEMODULE += event_thread USEMODULE += event_thread
USEMODULE += gnrc_ipv6_default USEMODULE += gnrc_ipv6_default
USEMODULE += gnrc_netif_single # Only one interface used and it makes USEMODULE += gnrc_netif_single # Only one interface used and it makes