GNU Make: Difference between revisions

Created page with '==.DELETE_ON_ERROR== * Generally, if make fails to build a target, and the target corresponds to a file, you want that file removed. ** Why might this happen? Ctrl-c being presse...'
 
No edit summary
Line 1: Line 1:
==.DELETE_ON_ERROR==
==Important [http://www.gnu.org/software/autoconf/manual/make/Special-Targets.html#Special-Targets Special Targets]==
===.DELETE_ON_ERROR===
* Generally, if make fails to build a target, and the target corresponds to a file, you want that file removed.
* Generally, if make fails to build a target, and the target corresponds to a file, you want that file removed.
** Why might this happen? Ctrl-c being pressed during a build. Multiple statements in a build recipe. Memory allocation failure during build. Any number of things.
** Why might this happen? Ctrl-c being pressed during a build. Multiple statements in a build recipe. Memory allocation failure during build. Any number of things.
Line 5: Line 6:
** <tt>kill -9</tt>'ing <tt>make</tt> will prevent this from happening! :/
** <tt>kill -9</tt>'ing <tt>make</tt> will prevent this from happening! :/
* [[gcc]] and some other tools will clean up on error, for some cases. Use <tt>.DELETE_ON_ERROR</tt> to be safe.
* [[gcc]] and some other tools will clean up on error, for some cases. Use <tt>.DELETE_ON_ERROR</tt> to be safe.
===.PHONY:===
* GNU Make manual section 4.6, "[http://www.gnu.org/software/autoconf/manual/make/Phony-Targets.html#Phony-Targets Phony Targets]"
* <tt>clean</tt>, <tt>all</tt>, <tt>test</tt> targets ought almost always be <tt>.PHONY</tt>
===.DEFAULT:===
* GNU Make manual section 10.6, "[http://www.gnu.org/software/autoconf/manual/make/Last-Resort.html Defining Last Resort Rules]"


==Make and [[subversion]]==
==Make and [[subversion]]==