Makefiles: Sorted & deduplicated rules in Makefile dep
#11238
Closed
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
The rules in
$(RIOTBASE)/Makefile.dep
that manage inter module dependencies are currently unsorted, which easily leads to duplicated rules such asSorting the rules alphabetically makes finding and extending existing rules easier and will help to prevent duplication. Also, the structure of the file was not well documented. As a result rules are easily placed at places the should not be placed.
Testing procedure
Murdock & code review. (I checked double checked that every rule to make sure I did not remove any rule by accident, but it makes sense to have many eyes checked that.
It is also worth to have a look at the impact on the build time on Murdock, as some of the rules have been sorted to let the recursive include of
Makefile.dep
terminate sooner. With the alphabetical sorting this is no longer the case, but most likely the additional recursions will not matter much.Issues/PRs references
The added documentation will hopefully prevent issues similar to the one introduced in #9988 from slipping in again.