aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2022-07-27 15:56:53 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2022-07-27 15:56:53 +0000
commit31a96ca5f0b6e5f8f7fa8cecf3a5c4354b3b096f (patch)
tree52bec57923751cf2491418dbd7ee4a62489ed5e2
parent308a28d6cd2e87028e535eabccb89a9dc2fd9515 (diff)
downloadsrc-31a96ca5f0b6e5f8f7fa8cecf3a5c4354b3b096f.tar.gz
src-31a96ca5f0b6e5f8f7fa8cecf3a5c4354b3b096f.zip
Import bmake-20220726vendor/NetBSD/bmake/20220726
Relevant/interesting changes: * Auto-create objdir for bmake/unit-tests if appropriate
-rw-r--r--ChangeLog6
-rw-r--r--Makefile21
-rw-r--r--VERSION2
-rw-r--r--unit-tests/Makefile3
4 files changed, 28 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index b9b5711e6e09..0762e4e6b925 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-07-26 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * VERSION (_MAKE_VERSION): 20220726
+
+ * Auto-create objdir for bmake/unit-tests if appropriate
+
2022-07-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20220724
diff --git a/Makefile b/Makefile
index 82d9db52af76..201e4869dc3f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.117 2021/12/04 18:51:30 sjg Exp $
+# $Id: Makefile,v 1.120 2022/07/26 23:02:54 sjg Exp $
PROG= bmake
@@ -215,7 +215,24 @@ install-mk:
# A simple unit-test driver to help catch regressions
TEST_MAKE ?= ${.OBJDIR}/${PROG:T}
-accept test:
+accept test: .NOMETA
cd ${.CURDIR}/unit-tests && \
MAKEFLAGS= ${TEST_MAKE} -r -m / ${.TARGET} ${TESTS:DTESTS=${TESTS:Q}}
+
+.if make(test) && ${MK_AUTO_OBJ} == "yes"
+# The test target above visits unit-tests with -r -m /
+# which prevents MK_AUTO_OBJ doing its job
+# so do it here
+.if defined(MAKEOBJDIRPREFIX) || ${MAKEOBJDIR:U:M*/*} != ""
+_utobj = ${.OBJDIR}/unit-tests
+.else
+_utobj = ${.CURDIR}/unit-tests/${MAKEOBJDIR:Uobj}
+.endif
+utobj: .NOMETA
+ @test -d ${_utobj} && exit 0; \
+ echo "[Creating ${_utobj}...]"; \
+ umask ${OBJDIR_UMASK:U002}; \
+ mkdir -p ${_utobj}
+test: utobj
+.endif
diff --git a/VERSION b/VERSION
index 34b791ec9d8f..bbf893546603 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
# keep this compatible with sh and make
-_MAKE_VERSION=20220724
+_MAKE_VERSION=20220726
diff --git a/unit-tests/Makefile b/unit-tests/Makefile
index de9720131535..10d8f32c61c7 100644
--- a/unit-tests/Makefile
+++ b/unit-tests/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.181 2022/06/13 00:18:20 sjg Exp $
+# $Id: Makefile,v 1.182 2022/07/26 19:39:32 sjg Exp $
#
# $NetBSD: Makefile,v 1.318 2022/06/10 21:28:50 rillig Exp $
#
@@ -501,6 +501,7 @@ ENV.depsrc-optional+= TZ=UTC
ENV.deptgt-phony+= MAKESYSPATH=.
ENV.directive-undef= ENV_VAR=env-value
ENV.envfirst= FROM_ENV=value-from-env
+ENV.opt-m-include-dir= ${MAKEOBJDIR:DMAKEOBJDIR=${MAKEOBJDIR}}
ENV.varmisc= FROM_ENV=env
ENV.varmisc+= FROM_ENV_BEFORE=env
ENV.varmisc+= FROM_ENV_AFTER=env