pYro_65:
No overhead for unused data. To achieve what you want, no mods are needed.
Same is true for code.
The gcc tools have gotten a lot more sophisticated/smarter in the past few years.
There are new options that put every single function and data element into its own section
and if there is no referenced to that section, the linker tosses it out.
It requires cooperation between the compiler and linker but the IDE turns on the
options to enable it.
make can do anything, since it just a dependency rule based system to run commands.
Most of the makefiles that I create for doing builds/compiles
use real libraries and create archive files and even peek into the archive files for dependencies.
I only wish the IDE was using meak underneath the covers vs trying to create their own set
of rules.
Much of the Arduino build nonsense that the IDE is doing and has been doing over the years would have been avoided.
As far as the libraries being real "libaries". The IDE is treating them similar to real libraries.
The distinction being that they are compiled separately vs being combined with users source when compiled.
The only thing not being done by the IDE is to combine the library objects into .a archive file.
The IDE does create a library archive file by combining all the core objects into a .a archive,
so for sure the Arduino core library is a true archive library.
In the early days, the IDE was combining everything into one mega gigantic file and then compiling it.
For many unsophisticated users, that probably would work better and even allow certain kinds
of optimizations that cannot be done when things are separate modules and compiled separately.
Maybe what was throwing me is this:
the Arduino libaries are not really libraries, but module of code that get included in the compile process.
as it was ambiguous to me.
I had assumed that you meant that the library source was getting included in the users sketch code
as part of the compile process where both were compiled together.
While that used to happen long ago, the current IDE process treats the libraries as libraries and compiles
the library modules separately. The only thing the IDE doesn't do right now is build a library archive .a file
for the libraries. (well it does for the core library).
--- bill