Merge pull request #13648 from fjmolinas/pr_periph_init_cleanup

Makefile.dep: filter periph_init modules
This commit is contained in:
Martine Lenders 2020-03-31 21:51:34 +02:00 committed by GitHub
commit 210543dd76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1064,29 +1064,37 @@ USEPKG := $(sort $(USEPKG))
ifneq ($(OLD_USEMODULE) $(OLD_USEPKG),$(USEMODULE) $(USEPKG)) ifneq ($(OLD_USEMODULE) $(OLD_USEPKG),$(USEMODULE) $(USEPKG))
include $(RIOTBASE)/Makefile.dep include $(RIOTBASE)/Makefile.dep
else else
# set all USED periph_% init modules as DEFAULT_MODULE # set all USED periph_% init modules as DEFAULT_MODULE
ifneq (,$(filter periph_init, $(USEMODULE))) ifneq (,$(filter periph_init, $(USEMODULE)))
DEFAULT_MODULE += $(subst periph_,periph_init_,$(filter periph_%,$(USEMODULE))) # To enable adding periph_% modules through the environment we cant use
# FEATURES_USED since the MODULE might be added directly as USEMODULE
PERIPH_MODULES_NO_INIT = periph_init% periph_common
PERIPH_MODULES = $(filter periph_%,$(USEMODULE))
PERIPH_INIT_MODULES = $(subst periph_,periph_init_,\
$(filter-out $(PERIPH_MODULES_NO_INIT),$(PERIPH_MODULES)))
DEFAULT_MODULE += $(PERIPH_INIT_MODULES)
endif
# add periph_init_% modules to USEMODULE unless disabled
ifneq (,$(filter periph_init, $(USEMODULE)))
USEMODULE += $(filter $(PERIPH_INIT_MODULES),\
$(filter-out $(DISABLE_MODULE),$(DEFAULT_MODULE)))
endif endif
# Add auto_init_% DEFAULT_MODULES. This is done after the recursive cach since # Add auto_init_% DEFAULT_MODULES. This is done after the recursive cach since
# none of these modules can trigger dependency resolution. # none of these modules can trigger dependency resolution.
DEFAULT_MODULE := $(sort $(DEFAULT_MODULE))
ifneq (,$(filter auto_init,$(USEMODULE))) ifneq (,$(filter auto_init,$(USEMODULE)))
USEMODULE += $(filter auto_init_%,$(filter-out $(DISABLE_MODULE),$(DEFAULT_MODULE))) USEMODULE += $(filter auto_init_%,$(filter-out $(DISABLE_MODULE),$(DEFAULT_MODULE)))
endif endif
# Add auto_init_periph_% to DEFAULT_MODULES. This is done after the recursive
# cach since none of these modules can trigger dependency resolution.
ifneq (,$(filter periph_init,$(USEMODULE)))
USEMODULE += $(filter periph_init_%,$(filter-out $(DISABLE_MODULE),$(DEFAULT_MODULE)))
endif
# Add test_utils_interactive_sync_shell # Add test_utils_interactive_sync_shell
ifneq (,$(filter test_utils_interactive_sync,$(USEMODULE))) ifneq (,$(filter test_utils_interactive_sync,$(USEMODULE)))
USEMODULE += $(filter test_utils_interactive_sync_%, \ USEMODULE += $(filter test_utils_interactive_sync_%, \
$(filter-out $(DISABLE_MODULE),$(DEFAULT_MODULE))) $(filter-out $(DISABLE_MODULE),$(DEFAULT_MODULE)))
endif endif
# Sort and remove duplicates
DEFAULT_MODULE := $(sort $(DEFAULT_MODULE))
USEMODULE := $(sort $(USEMODULE)) USEMODULE := $(sort $(USEMODULE))
endif endif