I thought about playing around with m4's extra macro processing features (over the regular cpp preprocessor) by merely, simply including it in the invoked chain of tools during the GCC compilation (rather right before cpp, so looks like as the first invoked command), however I don't know how to do it, i.e.: how to make m4 invoked as the (apparently) first stage of C gcc compilation of each of the input .c files. Is there some elegant method of achieving this?
Update: Apparently, the question might be more about build tools like autotools and CMake. I would be more interested in autotools.
I would be more interested in autotoolsJust add it to makefile.am, literallyfile.c: file.c.m4 m4 $< > $@, make will pick it up. As for cmake, justadd_custom_commandit, I did some more work with GNU m4 and CMake to trackm4_include(dependencies)from m4 and automatically recompile if dependencies changes, but I doubt the library is "user ready".