GNU Make: Difference between revisions

No edit summary
No edit summary
Line 18: Line 18:
** Most importantly, <tt>svn status</tt> should not show any entries in the 'M'odified state. This indicates either generated files being checked into source control, or the build process modifying source in-place (the same thing, really)
** Most importantly, <tt>svn status</tt> should not show any entries in the 'M'odified state. This indicates either generated files being checked into source control, or the build process modifying source in-place (the same thing, really)
** If <tt>svn:ignore</tt> is properly used, the following rule suffices as a project-independent <tt>clean</tt> target, assuming the presence of [[xmlstarlet]]:<pre>svn --xml --no-ignore status | xmlstarlet sel -t -m //entry -i "wc-status[@item='ignored']" -v @path -n | xargs rm -rf</pre>
** If <tt>svn:ignore</tt> is properly used, the following rule suffices as a project-independent <tt>clean</tt> target, assuming the presence of [[xmlstarlet]]:<pre>svn --xml --no-ignore status | xmlstarlet sel -t -m //entry -i "wc-status[@item='ignored']" -v @path -n | xargs rm -rf</pre>
==[[Shell|bash]] interactions==
* [http://www.gnu.org/s/hello/manual/make/Choosing-the-Shell.html The shell to use] can be specified via $(SHELL). By default, <tt>/bin/sh</tt> is used
** Unlike most variables, it cannot be inherited from the environment (except on Windows, where it is)
** It is not exported by default to sub-Makes, but [http://www.gnu.org/s/hello/manual/make/Variables_002fRecursion.html#Variables_002fRecursion it can be]
* Arguments to the shell can be specified via <tt>.SHELLFLAGS</tt>
** By default, it's <tt>-c</tt>, or <tt>-ec</tt> in POSIX mode
* Remember that errors in the body of a shell loop don't set the overall return value!<code>
target:
&+nbspwhile true ; do false ; done</code>This recipe cannot be successfully completed!