diff --git a/Makefile.features b/Makefile.features index 1e6de19cf7..7b7731703a 100644 --- a/Makefile.features +++ b/Makefile.features @@ -25,8 +25,7 @@ endif # Features that are required by the application but not provided by the BSP and # features that are used but blacklisted (prepended with "!"). # Having features missing may case the build to fail. -FEATURES_MISSING = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_REQUIRED)) \ - $(call _features_used_blacklisted)) +FEATURES_MISSING = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_REQUIRED))) # Features that are only optional and not required at the same time. # The policy is to by default use by features if they are provided by the BSP. @@ -50,6 +49,6 @@ _features_conflicting = $(if $(call _features_used_conflicting,$(subst :, ,$1)), # Return non empty on error _features_used_conflicting = $(filter $(words $1),$(words $(filter $(FEATURES_USED),$1))) -# Return features that are used but blacklisted as -# "!" ("not feature") -_features_used_blacklisted = $(addprefix !,$(sort $(filter $(FEATURES_USED), $(FEATURES_BLACKLIST)))) +# Features that are used by the application but blacklisted by the BSP. +# Having blacklisted features may cause the build to fail. +FEATURES_USED_BLACKLISTED = $(sort $(filter $(FEATURES_USED), $(FEATURES_BLACKLIST))) diff --git a/Makefile.include b/Makefile.include index da39ecaadf..7a9ff45f89 100644 --- a/Makefile.include +++ b/Makefile.include @@ -732,9 +732,6 @@ ifneq (, $(filter all flash, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all))) EXPECT_ERRORS := 1 endif - # turn provided but blacklisted features into required "!" - FEATURES_REQUIRED += $(addprefix !,$(sort $(filter $(FEATURES_PROVIDED), $(FEATURES_BLACKLIST)))) - # Test if all feature requirements were met by the selected board. ifneq (,$(FEATURES_MISSING)) $(shell $(COLOR_ECHO) "$(COLOR_RED)There are unsatisfied feature requirements:$(COLOR_RESET)"\ @@ -742,6 +739,13 @@ ifneq (, $(filter all flash, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all))) EXPECT_ERRORS := 1 endif + # Test if no feature in the requirements used is blacklisted for the selected board. + ifneq (,$(FEATURES_USED_BLACKLISTED)) + $(shell $(COLOR_ECHO) "$(COLOR_RED)Some feature requirements are blacklisted:$(COLOR_RESET)"\ + "$(FEATURES_USED_BLACKLISTED)" 1>&2) + EXPECT_ERRORS := 1 + endif + # Test if any used feature conflict with another one. ifneq (,$(FEATURES_CONFLICTING)) $(shell $(COLOR_ECHO) "$(COLOR_YELLOW)The following features may conflict:$(COLOR_RESET)"\