How does Makefile know that a file changed and then recompile it?

makeMonday picture makeMonday · Mar 25, 2014 · Viewed 10.2k times · Source

Just out of curiosity, how does Makefile know that a file changed (and then recompile it)? Is it up to make? Is it up to the compiler? If so, is it language dependent?

Answer

Clifford picture Clifford · Mar 25, 2014

It looks at the file time-stamp - simple as that. If a dependency is newer that the target, the target is rebuilt.