Hacker News new | ask | show | jobs
by ZirconiumX 2699 days ago
But you also need compatibility with #include, so your build system also needs to become a preprocessor.
1 comments

The preprocessor is a self-contained binary. The build system can just pipe through it.
The C and I presume C++ standard has been very carefully avoiding the idea of a preprocessor being separate at all. The standard was very carefully worded to prevent that being necessary, because most C compilers do not have a separate preprocessor. It is only Unix heritage compilers that really have one, and even they're not consistent about it.
I'm curious how you plan to detect dependencies from a file by piping it through a command that removes those dependencies.