Is there any reason not to use the Arduino IDE from the command line?
For simplicity, let's assume that all of the source files are located in the current directory.
Also, there is a main.c file which contains the actual entry point and no further pre-processing needs to be done
Here's how the suggestion looks like in detail:The Arduino IDE creates a scratch directory and copies the core modules and libraries into that directory
The Arduino IDE performs additional preparation steps such as adding #include statements and creating the actual main.c file based on the scratch
The Arduino IDE generates a Makefile which builds all of the source files (core, libraries, sketch) and the HEX file. The Makefile should have two targets: "compile" and "program". Those targets are linked to the buttons "verify" and "upload" in the IDE.
[existing makefiles] have way too many config options
Why do I need this? I would like to do different builds for testing (on the host machine) as well as production (the microcontroller target).
Though I'm not sure what those are, exactly...
It's not as simple as you seem to think.
All you need is a hardware abstraction layer.
the executable was significantly bigger than the one produced by the Arduino IDE.