Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11492 from cladmi/pr/features/declarative
Makefile.features: add declarative FEATURES_ variables definition
- Loading branch information
Showing
5 changed files
with
54 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,33 @@ | ||
# 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))) | ||
|
||
# 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. | ||
FEATURES_OPTIONAL_ONLY = $(sort $(filter-out $(FEATURES_REQUIRED),$(FEATURES_OPTIONAL))) | ||
FEATURES_OPTIONAL_USED = $(sort $(filter $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY))) | ||
# Optional features that will not be used because they are not provided | ||
FEATURES_OPTIONAL_MISSING = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY))) | ||
|
||
# Features that are used for an application | ||
FEATURES_USED = $(sort $(FEATURES_REQUIRED) $(FEATURES_OPTIONAL_USED)) | ||
|
||
# Used features that conflict when used together | ||
FEATURES_CONFLICTING = $(sort $(foreach conflict,$(FEATURES_CONFLICT),$(call _features_conflicting,$(conflict)))) | ||
|
||
# Return conflicting features from the conflict string feature1:feature2 | ||
# $1: feature1:feature2 | ||
# Return the list of conflicting features | ||
_features_conflicting = $(if $(call _features_used_conflicting,$(subst :, ,$1)),$(subst :, ,$1)) | ||
# Check if all features from the list are used | ||
# $1: list of features that conflict together | ||
# Return non empty on error | ||
_features_used_conflicting = $(filter $(words $1),$(words $(filter $(FEATURES_USED),$1))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters