Yes, I read that page (several times).
You can specify sources by source or use default - all in root dir.
I did figure that out, though it took some careful reading to find it — it's mentioned very briefly, in the middle of a list of command-line arguments. It's a pretty important point, so IMHO it should at least be a section "Adding source files" or "Configuring source code location" or something.
I would really, really, like this to be something that could be put in a config file in the project root directory. For example, I'm going to have to list about eight source directories, so the command line will get rather lengthy. (Unless the build system recurses into subdirectories automatically? That will cut it down a bit.)
Use keywords like TOOLCHAIN_/TARGET_NAME for folder names (see the directory structure in Mbed OS for examples).
In the OS source there are source subdirectories with names like "TARGET_CORTEX"; is that what you mean? I'm not asking about how to restrict files to a particular embedded platform, rather how to control what gets compiled at all by mbed.
Or use mbedignore file to ignore files/directories. This should answer also the second item.
Ah, I see, there are a bunch of invisible `.mbedignore` files in the mbed.os source. They seem to have the same syntax as `.gitignore` files, i.e. one globbed path per line. I think I can work with this, especially since I can put one in my own repo and have it control what gets compiled in submodules whose file layout I can't change.
Check toolchain profiles for those settings. You can create your own one if needed.
Sorry, I don't know what this means. What/where are toolchain profiles?
Thanks for the help! It looks like you work on mbed; could you please request that the docs team add the above info to the web page?
I'm getting started using the mbed-cli, and it seems like either this is a very primitive tool, or else there's just no documentation beyond the bare basics.
The docs explain how to create a new project and compile. Great. But they don't explain how to control what source files get compiled, what compiler/linker settings are used, or any of the other nitty-gritty of building a nontrivial project. (By contrast, the last build system I learned, Espressif's ESP-IDF, has a pretty polished and well-documented build system(1) based on 'make', and an upcoming one using CMake.)
I've got a medium-large source base that lives in multiple directories, with some files that are platform-specific, and has three or four submodules. Issues I'm running into right off the bat:
Are these supported features that just aren't documented? Or is the mbed-cli only meant for very simple projects?
(1) https://esp-idf.readthedocs.io/en/latest/api-guides/build-system.html