3 ms·
Actually, the compilers do not and you are doing less than half of the job there. They don't emit information about the non-existent files that would change th
by JdeBP 5y ago
Actually, the compilers do not and you are doing less than half of the job there. They don't emit information about the non-existent files that would change the build if they were to suddenly exist, such as an "x.h" in one of several standard search directories in that example.
* http://jdebp.uk./FGA/introduction-to-redo.html#CompilerDeficiencies http://jdebp.uk./FGA/introduction-to-redo.html#CompilerDefic...
- glandium 5y agoAlso they don't add an empty rule for the source file (like they can do for headers), so if you rename from e.g. foo.c to foo.cpp, which still produces a foo.o, your incremental build fails because the dep file still has the dep on foo.c which doesn't exist anymore.
- brandmeyer 5y agoThe original sin here is generating the dependencies from the source files in the same step that was used to generate the object files. The only way to ensure that Make observes structural changes in the dependency DAG is if the graph is rebuilt.
- glandium 5y agoGood old "make depend". If only it didn't add a significant overhead...
- brandmeyer 5y agoYou can get make to only re-generate its rules incrementally based on what was changed. https://www.gnu.org/software/make/manual/html_node/Remaking-Makefiles.html#Remaking-Makefiles https://www.gnu.org/software/make/manual/html_node/Remaking-...
- sigjuice 5y agoLooks like gcc does not plan to do this https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28810 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28810
- sigjuice 5y agoIf a /usr/include/x.h were to appear, wouldn't that have lower priority than the x.h in the current directory and therefore not change the build?