One of the software modules of my embedded C project has a varying number of source files for each release of this module.
Note: This happens because they are being auto generated by a codegen tool.
So each time I have to build my project, the CMake build script fetches and compiles this separate source files, leaving the object files in a separate folder just for specific this software module.
After that, the linker script looks for these files one-by-one using their name. But that is not very scalable. I’d like to instruct the linker script to add all object files inside one particular folder to a given memory region.
Here’s what I already tried and did not work:
*path/to/my/directory/*.c.obj(.bss)
path/to/my/directory/*.c.obj(.bss)
*path/*.c.obj(.bss)
path/*.c.obj(.bss)
Here’s what currently works:
*my_file_name.c.obj(.bss) /* Without any path and directory definition */
All my object files can be located inside one top-level build
folder on my project structure.
Diogo Freitas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.