-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Build system: support for application subfolders #20024
Conversation
3183e9a
to
60661f5
Compare
I'm personally not fully convinced that this solves a real problem. As you pointed out, the build system does support external modules. Those do require a one-liner More generally: The buildsystem is a pain in the ass to maintain as it is and few maintainers like to actually maintain it, most maintainers/developers much rather maintain/write C code than Makefiles. I'm personally reluctant on adding features that makes niche use cases a tiny bit more convenient. And again: I personally don't think that this indeed is an improvement over using external modules, anyway. |
@mguetschow so far two maintainer have voted against this and there has been little interest. Do you want convert it into a draft and discuss / find a common ground? |
@maribu only for applications, this feature can be beneficial. It allows for easy organization of folders and subfolders without having to create a module each time. It's also better for people discovering RIOT, as it seems easier to create one file and add SRC in it than to create a Makefile for each folder in an application. |
I've come across the need for subfolder SRC for external packages as well, whose folder structure is not under RIOT's control. |
60661f5
to
51613c8
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.
Let's have this.
Requests for this feature have been popping up in the Matrix chat and in the forum a few times. I think it is fair to say that this proves me wrong that just using modules for code organization is sufficient.
The code changes look sane to me and I trust your testing.
We actually had a side-discussion with @plmorange over at mguetschow#1. They proposed a test for the BLOB in subfolder case and I was wondering if the application showcasing the subfolder functionality should actually rather go into |
Hmm, given how often this question popped up recently, I'd personally favor the example to increase visibility. But I think both are fine. |
Co-authored-by: plmorange <pierre1.lemeur@orange.com>
d36b232
to
518f75f
Compare
@plmorange I've now reworded the documentation to mainly link to the example. Also I found that there was already a test for testing blob files in subdirectories with @maribu After checking the CI generated documentation, this should be ready for merge. |
Thank you all! |
Contribution description
Currently, it is not possible to:
Makefile
Using RIOT modules for subfolders has two drawbacks which I found annoying enough to look into this:
Makefile
(see also How to use subdirectories in project workspace #13007 (comment))This PR addresses both issues by:
SRC
,SRCXX
,ASMSRC
andASSMSRC
down to the recursive call tomake
for the application module, following the approach used forBLOB
SRC
and friends (the automatic recognition of source files is still restricted to the application/module folder)Additionally, it adds a Makefile warning to ensure users are not using the same subfolder both as a RIOT module and manually in
SRC
(inspired by a chat with @miri64 about this topic).Testing procedure
The second commit adds an example that show-cases both the traditional RIOT module approach and the newly supported
SRC
variable approach inexamples/subfolders
.