mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #12453 from aabadie/pr/make/features_blacklisted
make: handle blacklisted features separately from missing requirements
This commit is contained in:
commit
6c7acf4188
@ -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
|
||||
# "!<feature>" ("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)))
|
||||
|
@ -735,9 +735,6 @@ ifneq (, $(filter all flash, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)))
|
||||
EXPECT_ERRORS := 1
|
||||
endif
|
||||
|
||||
# turn provided but blacklisted features into required "!<feature>"
|
||||
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)"\
|
||||
@ -745,6 +742,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)"\
|
||||
|
@ -11,7 +11,7 @@ DISABLE_MODULE_GLOBAL := $(DISABLE_MODULE)
|
||||
DEFAULT_MODULE_GLOBAL := $(DEFAULT_MODULE)
|
||||
FEATURES_BLACKLIST_GLOBAL := $(FEATURES_BLACKLIST)
|
||||
|
||||
define board_missing_features
|
||||
define board_unsatisfied_features
|
||||
BOARD := $(1)
|
||||
USEMODULE := $(USEMODULE_GLOBAL)
|
||||
USEPKG := $(USEPKG_GLOBAL)
|
||||
@ -43,6 +43,11 @@ define board_missing_features
|
||||
BOARDS_WITH_MISSING_FEATURES += $(1)
|
||||
endif
|
||||
|
||||
ifneq (,$$(FEATURES_USED_BLACKLISTED))
|
||||
BOARDS_FEATURES_USED_BLACKLISTED += "$(1) $$(FEATURES_USED_BLACKLISTED)"
|
||||
BOARDS_WITH_BLACKLISTED_FEATURES += $(1)
|
||||
endif
|
||||
|
||||
ifneq (,$$(DEPENDENCY_DEBUG))
|
||||
$$(call file_save_dependencies_variables,dependencies_info-boards-supported)
|
||||
endif
|
||||
@ -53,8 +58,11 @@ BOARDS := $(filter-out $(BOARD_BLACKLIST), $(BOARDS))
|
||||
|
||||
BOARDS_WITH_MISSING_FEATURES :=
|
||||
BOARDS_FEATURES_MISSING :=
|
||||
$(foreach BOARD, $(BOARDS), $(eval $(call board_missing_features,$(BOARD))))
|
||||
BOARDS := $(filter-out $(BOARDS_WITH_MISSING_FEATURES), $(BOARDS))
|
||||
BOARDS_WITH_BLACKLISTED_FEATURES :=
|
||||
BOARDS_FEATURES_USED_BLACKLISTED :=
|
||||
|
||||
$(foreach BOARD, $(BOARDS), $(eval $(call board_unsatisfied_features,$(BOARD))))
|
||||
BOARDS := $(filter-out $(BOARDS_WITH_MISSING_FEATURES) $(BOARDS_WITH_BLACKLISTED_FEATURES), $(BOARDS))
|
||||
|
||||
info-buildsizes: SHELL=bash
|
||||
info-buildsizes:
|
||||
|
@ -62,6 +62,8 @@ info-build:
|
||||
@echo ' $(or $(FEATURES_MISSING), -none-)'
|
||||
@echo 'FEATURES_BLACKLIST (blacklisted features):'
|
||||
@echo ' $(or $(sort $(FEATURES_BLACKLIST)), -none-)'
|
||||
@echo 'FEATURES_USED_BLACKLISTED (used but blacklisted features):'
|
||||
@echo ' $(or $(sort $(FEATURES_USED_BLACKLISTED)), -none-)'
|
||||
@echo ''
|
||||
@echo 'FEATURES_CONFLICT: $(FEATURES_CONFLICT)'
|
||||
@echo 'FEATURES_CONFLICT_MSG: $(FEATURES_CONFLICT_MSG)'
|
||||
|
Loading…
Reference in New Issue
Block a user