summaryrefslogtreecommitdiff
path: root/doc/make.texi
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2010-07-06 06:37:42 +0000
committerPaul Smith <psmith@gnu.org>2010-07-06 06:37:42 +0000
commitc7b469f0f337247acb83067d8f4aa4dc76b8a9a9 (patch)
treeb3b657564a46ef50c7478480f2659064b7e0d12d /doc/make.texi
parentc78b7265bd1ee374a5e515d79448d0e3452b5ede (diff)
downloadgunmake-c7b469f0f337247acb83067d8f4aa4dc76b8a9a9.tar.gz
- Enhance .POSIX to set -e when invoking shells, as demanded by a
backward-incompatible change in the 2008 POSIX specification. - Add the .SHELLFLAGS variable so people can choose their own shell flags. - Add tests for this. - Add documentation for this.
Diffstat (limited to 'doc/make.texi')
-rw-r--r--doc/make.texi22
1 files changed, 21 insertions, 1 deletions
diff --git a/doc/make.texi b/doc/make.texi
index 7187e19..35a40dd 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -2873,6 +2873,21 @@ of @code{make} will be run serially, even if the @samp{-j} option is
given. Any recursively invoked @code{make} command will still run
recipes in parallel (unless its makefile also contains this target).
Any prerequisites on this target are ignored.
+
+@findex .POSIX
+@item .POSIX
+@cindex POSIX-conforming mode, setting
+
+If @code{.POSIX} is mentioned as a target, then the makefile will be
+parsed and run in POSIX-conforming mode. This does @emph{not} mean
+that only POSIX-conforming makefiles will be accepted: all advanced
+GNU @code{make} features are still available. Rather, this target
+causes @code{make} to behave as required by POSIX in those areas
+where @code{make}'s default behavior differs.
+
+In particular, if this target is mentioned then recipes will be
+invoked as if the shell had been passed the @code{-e} flag: the first
+failing command in a recipe will cause the recipe to fail immediately.
@end table
Any defined implicit rule suffix also counts as a special target if it
@@ -3713,11 +3728,16 @@ truncated, at least).
@subsection Choosing the Shell
@cindex shell, choosing the
@cindex @code{SHELL}, value of
+@cindex @code{.SHELLFLAGS}, value of
@vindex SHELL
+@vindex .SHELLFLAGS
The program used as the shell is taken from the variable @code{SHELL}.
If this variable is not set in your makefile, the program
-@file{/bin/sh} is used as the shell.
+@file{/bin/sh} is used as the shell. The argument(s) passed to the
+shell are taken from the variable @code{.SHELLFLAGS}. The default
+value of @code{.SHELLFLAGS} is @code{-c} normally, or @code{-ec} in
+POSIX-conforming mode.
@cindex environment, @code{SHELL} in
Unlike most variables, the variable @code{SHELL} is never set from the