svn commit: r254980 - head/share/mk
Simon J. Gerraty
sjg at FreeBSD.org
Tue Aug 27 23:09:35 UTC 2013
Author: sjg
Date: Tue Aug 27 23:09:34 2013
New Revision: 254980
URL: http://svnweb.freebsd.org/changeset/base/254980
Log:
Use .SHELL to tell bmake to use 'set -e' when running scripts
since most FreeBSD makefiles it is in effect.
Move the other bmake compatability knobs out of the POSIX block.
Reviewed by: obrien
Modified:
head/share/mk/sys.mk
Modified: head/share/mk/sys.mk
==============================================================================
--- head/share/mk/sys.mk Tue Aug 27 23:02:20 2013 (r254979)
+++ head/share/mk/sys.mk Tue Aug 27 23:09:34 2013 (r254980)
@@ -332,12 +332,6 @@ SHELL= ${__MAKE_SHELL}
.SHELL: path=${__MAKE_SHELL}
.endif
-# Tell bmake to expand -V VAR by default
-.MAKE.EXPAND_VARIABLES= yes
-
-# Tell bmake the makefile preference
-.MAKE.MAKEFILE_PREFERENCE= BSDmakefile makefile Makefile
-
.if !defined(.PARSEDIR)
# We are not bmake, which is more aggressive about searching .PATH
# It is sometime necessary to curb its enthusiasm with .NOPATH
@@ -351,4 +345,24 @@ SHELL= ${__MAKE_SHELL}
.endif
+.if defined(.PARSEDIR)
+# Tell bmake to expand -V VAR by default
+.MAKE.EXPAND_VARIABLES= yes
+
+# Tell bmake the makefile preference
+.MAKE.MAKEFILE_PREFERENCE= BSDmakefile makefile Makefile
+
+# By default bmake does *not* use set -e
+# when running target scripts, this is a problem for many makefiles here.
+# So define a shell that will do what FreeBSD expects.
+.ifndef WITHOUT_SHELL_ERRCTL
+.SHELL: name=sh \
+ quiet="set -" echo="set -v" filter="set -" \
+ hasErrCtl=yes check="set -e" ignore="set +e" \
+ echoFlag=v errFlag=e \
+ path=${__MAKE_SHELL:U/bin/sh}
+.endif
+
+.endif
+
.include <bsd.cpu.mk>
More information about the svn-src-head
mailing list