Makefile.include: include Makefile.features after $(CPU)/Makefile.include #11424
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
Currently in base Makefile.include, Makefile.fatures for a BOARD is included after
$(RIOTCPU)/$(CPU)/Makefile.include
.RIOT/Makefile.include
Lines 247 to 258 in 9a64731
This causes the below statement to have no effect since KINETIS_SERIES isn't defined at this point. But more generaly means none of the variables defined are in
$(RIOTCPU)/$(CPU)/Makefile.include
are yet available.RIOT/cpu/kinetis/Makefile.features
Lines 5 to 9 in 9a64731
Moving Makfile.features below
include $(RIOTCPU)/$(CPU)/Makefile.include
. would allow using the SERIES, FAMILY, etc. to include some features for the specific group.I'm not sure of the impact of this change, I would like @cladmi insight on the matter. Based on my inspection of the build system there would be no negative impact since FEATURES_PROVIDED are first used by Makefile.dep. Also Makefile.features files only reference themselves so this doesn't affect the include
$(RIOTBOARD)/$(BOARD)/Makefile.include
and$(RIOTCPU)/$(CPU)/Makefile.include
.Testing procedure
All applications for all boards should still compile as expected.
To see this fixes #11423 add
$(info Kinetis series: $(KINETIS_SERIES))
just before the above the code below and callmake -C examples/hello-world/ BOARD=pba-d-01-kw2x
.RIOT/cpu/kinetis/Makefile.features
Lines 5 to 9 in 9a64731
Without this PR:
Without this PR:
Issues/PRs references
Could fix #11423.
Related to #8713