Search code examples
linuxmakefilerobustness

How robust is make?


How robust is the make utility?

For example, while "making" something, if the computer loses power, and make is resumed after the next computer start, is the output guaranteed to be correct (even if the file system is not robust)? Are there any other situation in which make may fail?


Solution

  • Make is writing to the file system while it's running. Therefore if it is interrupted (for instance if the computer loses power or the user kills the process) in the middle of doing that, incomplete files might be written to the file system, unless the file system has some kind of mechanism preventing this (ZFS for instance).

    GNU Make itself does not detect whether or not a file is incomplete or broken. As long as it is present in the file system with a timestamp Make considers it being complete.