summaryrefslogtreecommitdiffstats
path: root/share/mk
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2013-08-27 23:09:34 +0000
committersjg <sjg@FreeBSD.org>2013-08-27 23:09:34 +0000
commit142ae774787196df15d7965d81632504d56cd76d (patch)
treee10ca3cef2e380d3f6f66eb5e2247587268a9618 /share/mk
parentd0a699d53c2a04569b291206089fe531b5e57b82 (diff)
downloadFreeBSD-src-142ae774787196df15d7965d81632504d56cd76d.zip
FreeBSD-src-142ae774787196df15d7965d81632504d56cd76d.tar.gz
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
Diffstat (limited to 'share/mk')
-rw-r--r--share/mk/sys.mk26
1 files changed, 20 insertions, 6 deletions
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index cdab3d6..eb9f2ca 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -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>
OpenPOWER on IntegriCloud