Makefile.features: declare FEATURES_MISSING and make use of it

Put the definition of `FEATURES_MISSING` in common and use the variable
instead of duplicating code.
This commit is contained in:
Gaëtan Harter 2019-05-03 16:19:20 +02:00
parent 700b5fb835
commit e1c60ead36
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B
4 changed files with 13 additions and 7 deletions

View File

@ -1,3 +1,11 @@
# Process FEATURES variables
include $(RIOTBOARD)/$(BOARD)/Makefile.features
# Resolve FEATURES_ variables
# Their value will only be complete after resolving dependencies
# Features that are required by the application but not provided by the BSP
# Having features missing may case the build to fail.
FEATURES_MISSING = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_REQUIRED)))

View File

@ -622,9 +622,9 @@ ifneq (, $(filter all flash, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)))
endif
# Test if all feature requirements were met by the selected board.
ifneq (,$(filter-out $(FEATURES_PROVIDED), $(FEATURES_REQUIRED)))
ifneq (,$(FEATURES_MISSING))
$(shell $(COLOR_ECHO) "$(COLOR_RED)There are unsatisfied feature requirements:$(COLOR_RESET)"\
"$(sort $(filter-out $(FEATURES_PROVIDED), $(FEATURES_REQUIRED)))" 1>&2)
"$(FEATURES_MISSING)" 1>&2)
EXPECT_ERRORS := 1
endif

View File

@ -14,7 +14,6 @@ define board_missing_features
DISABLE_MODULE := $(DISABLE_MODULE_GLOBAL)
FEATURES_REQUIRED := $(FEATURES_REQUIRED_GLOBAL)
FEATURES_OPTIONAL := $(FEATURES_OPTIONAL_GLOBAL)
FEATURES_MISSING :=
FEATURES_PROVIDED :=
include $(RIOTBASE)/Makefile.features
@ -28,8 +27,7 @@ define board_missing_features
include $(RIOTBASE)/Makefile.dep
FEATURES_MISSING := $$(sort $$(filter-out $$(FEATURES_PROVIDED), $$(FEATURES_REQUIRED)))
ifneq (, $$(FEATURES_MISSING))
ifneq (,$$(FEATURES_MISSING))
BOARDS_FEATURES_MISSING += "$(1) $$(FEATURES_MISSING)"
BOARDS_WITH_MISSING_FEATURES += $(1)
endif

View File

@ -57,7 +57,7 @@ info-build:
@echo 'FEATURES_MISSING (incl. optional features):'
@echo ' $(or $(sort $(filter-out $(FEATURES_PROVIDED), $(FEATURES_REQUIRED) $(FEATURES_OPTIONAL))), -none-)'
@echo 'FEATURES_MISSING (only non optional features):'
@echo ' $(or $(sort $(filter-out $(FEATURES_PROVIDED), $(FEATURES_REQUIRED))), -none-)'
@echo ' $(or $(FEATURES_MISSING), -none-)'
@echo ''
@echo 'FEATURES_CONFLICT: $(FEATURES_CONFLICT)'
@echo 'FEATURES_CONFLICT_MSG: $(FEATURES_CONFLICT_MSG)'
@ -130,7 +130,7 @@ info-features-required:
@for i in $(sort $(FEATURES_REQUIRED)); do echo $$i; done
info-features-missing:
@for i in $(sort $(filter-out $(FEATURES_PROVIDED), $(FEATURES_REQUIRED))); do echo $$i; done
@for i in $(FEATURES_MISSING); do echo $$i; done
info-debug-variable-%:
@echo $($*)