diff --git a/Makefile.features b/Makefile.features index 7308914515..6a06002adc 100644 --- a/Makefile.features +++ b/Makefile.features @@ -4,6 +4,9 @@ # variables in their Makefile.features. # This makes them available when setting features based on CPU_MODEL in the cpu # Makefile.features and also during dependency resolution. +# +# Board features defined by common code in `boards/common` are processed +# during the dependency resolution, since they depend on the USEMODULE. # Transition: # Moving 'CPU/CPU_MODEL' to Makefile.features is an ongoing work and may not @@ -11,9 +14,6 @@ include $(BOARDDIR)/Makefile.features -# include global Makefile.features for `boards` modules -include $(RIOTBOARD)/Makefile.features - # Sanity check ifeq (,$(CPU)) $(error $(BOARD): CPU must be defined by board / board_common Makefile.features) diff --git a/makefiles/dependency_resolution.inc.mk b/makefiles/dependency_resolution.inc.mk index 8003a10e90..e3c5ea8bd2 100644 --- a/makefiles/dependency_resolution.inc.mk +++ b/makefiles/dependency_resolution.inc.mk @@ -17,6 +17,10 @@ OLD_STATE := $(USEMODULE) $(USEPKG) $(FEATURES_USED) # pull in dependencies of the currently used modules and pkgs include $(RIOTBASE)/Makefile.dep +# include the global board features before the feature check as they depend +# on the USEMODULE, which is present after the `Makefile.dep` resolution +include $(RIOTBOARD)/Makefile.features + # check if required features are provided and update $(FEATURES_USED) include $(RIOTMAKE)/features_check.inc.mk