-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Buildsystem: Introduce Global Makefiles for boards
Directory
#21327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
11cfaa5
to
df30029
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this clean-up! Thanks a lot!
Just two minor things below, and testing is still outstanding on my side.
c646f8a
to
3f2aa15
Compare
071a53b
to
b7e42ed
Compare
Squashed and documentation added. Thank you for reviewing :) |
doc/doxygen/src/porting-boards.md
Outdated
@@ -330,6 +351,20 @@ FEATURES_PROVIDED += periph_uart | |||
include $(RIOTBOARD)/common/foo_common/Makefile.features | |||
``` | |||
|
|||
If the common code includes source files or headers, it might be necessary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the common code includes source files or headers, it might be necessary | |
If the common code includes source files, it might be necessary |
headers would have to go into Makefile.include
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. My thinking was that the make system won't even look at the directory at all without the DIRS +=
, but in the old style, the Makefile.include
was always added with an include
statement, so the remark about the headers is redundant.
Successfully tested on |
b7e42ed
to
76af091
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this! 💙
@mguetschow thank you for working with me on this :) |
Contribution description
Many boards in RIOT (such as the feather-nrf52840, feather-m0, ...) use common board definitions for things like the bootloader. Back when this was implemented in #8058, the approach was to include the directory by adding the path to the DIRS variable and setting the USEMODULE in one of the common folders.
This is not really elegant and the Makefile in the boards/common/... subfolder didn't even get executed.
You can find more information about this in #21298.
The original approach from #21299 was to automatically add the directories based on the
USEMODULE
name, for example add the directoryboards/common/adafruit-nrf52-bootloader
when usingUSEMODULE += boards_common_adafruit-nrf52-bootloader
.This might have unintended side effects since this was not originally intended, so the proposal from @mguetschow from #21299 (comment) was chosen.
This PR therefore introduces the new Makefiles
boards/Makefile
,boards/Makefile.include
,boards/Makefile.dep
andboards/Makefile.features
to automatically include the right Makefiles when using certain modules.For example in the current master when using the
boards/common/adafruit-nrf52-bootloader
common folder, you have to explicitly add the directory in yourboard/myboard/Makefile
, add the commonMakefile.include
in yourboard/myboard/Makefile.include
and add the commonMakefile.dep
in yourboard/myboard/Makefile.dep
.With this PR, this is not necessary anymore because these includes are done in the
boards/Makefile{,.features,.include,.dep}
files now.This approach would also work for the
cpu/
subfolder, but for the time being I'd like to do this step by step (not looking at you #21299 👀).TODO: I would like to extend the
Porting Boards
documentation to include information about common board modules and how to use (and possibly even how to create) them.Testing procedure
Make sure the boards still compile and the common folder is still included.
Compilation of tests/sys/shell for the seeedstudio-xiao-nrf52840 on master:
Compilation of tests/sys/shell for the seeedstudio-xiao-nrf52840 with this PR:
Issues/PRs references
Fixes #21298.
Alternative approach for #21299.