Build system: support for application subfolders#20024
Build system: support for application subfolders#20024maribu merged 3 commits intoRIOT-OS:masterfrom
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
maribu
left a comment
There was a problem hiding this comment.
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. |
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:
MakefileUsing 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,ASMSRCandASSMSRCdown to the recursive call tomakefor the application module, following the approach used forBLOBSRCand 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
SRCvariable approach inexamples/subfolders.