make: Interrupts

1 
1 5.6 Interrupting or Killing 'make'
1 ==================================
1 
1 If 'make' gets a fatal signal while a shell is executing, it may delete
1 the target file that the recipe was supposed to update.  This is done if
1 the target file's last-modification time has changed since 'make' first
1 checked it.
1 
1    The purpose of deleting the target is to make sure that it is remade
1 from scratch when 'make' is next run.  Why is this?  Suppose you type
1 'Ctrl-c' while a compiler is running, and it has begun to write an
1 object file 'foo.o'.  The 'Ctrl-c' kills the compiler, resulting in an
1 incomplete file whose last-modification time is newer than the source
1 file 'foo.c'.  But 'make' also receives the 'Ctrl-c' signal and deletes
1 this incomplete file.  If 'make' did not do this, the next invocation of
1 'make' would think that 'foo.o' did not require updating--resulting in a
1 strange error message from the linker when it tries to link an object
1 file half of which is missing.
1 
1    You can prevent the deletion of a target file in this way by making
1 the special target '.PRECIOUS' depend on it.  Before remaking a target,
1 'make' checks to see whether it appears on the prerequisites of
1 '.PRECIOUS', and thereby decides whether the target should be deleted if
1 a signal happens.  Some reasons why you might do this are that the
1 target is updated in some atomic fashion, or exists only to record a
1 modification-time (its contents do not matter), or must exist at all
1 times to prevent other sorts of trouble.
1