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#CompilerDefic...