aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.inc17
-rw-r--r--etc/Makefile5
-rw-r--r--share/mk/bsd.subdir.mk2
-rw-r--r--share/mk/bsd.test.mk9
4 files changed, 22 insertions, 1 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index c9f41e1491bc..344da994ef32 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -776,6 +776,9 @@ EXTRA_DISTRIBUTIONS+= games
.if defined(LIB32TMP) && ${MK_LIB32} != "no"
EXTRA_DISTRIBUTIONS+= lib32
.endif
+.if ${MK_TESTS} != "no"
+EXTRA_DISTRIBUTIONS+= tests
+.endif
MTREE_MAGIC?= mtree 2.0
@@ -817,6 +820,10 @@ distributeworld installworld: _installcheck_world
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
.endif
+.if ${MK_TESTS} != "no" && ${dist} == "tests"
+ mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
+ -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
+.endif
.if defined(NO_ROOT)
${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
sed -e 's#^\./#./${dist}/#' >> ${METALOG}
diff --git a/etc/Makefile b/etc/Makefile
index 861504695ef4..4f1636bcb58d 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -174,7 +174,10 @@ afterinstall:
.endif
distribute:
- ${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
+ # Avoid installing tests here; "make distribution" will do this and
+ # correctly place them in the right location.
+ ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
+ DESTDIR=${DISTDIR}/${DISTRIBUTION}
${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
.include <bsd.endian.mk>
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk
index b93a5d7fac43..b0ce12039088 100644
--- a/share/mk/bsd.subdir.mk
+++ b/share/mk/bsd.subdir.mk
@@ -81,6 +81,7 @@ __subdir_targets+= .WAIT
.else
__subdir_targets+= ${__target}_subdir_${__dir}
${__target}_subdir_${__dir}: .MAKE
+.if !defined(NO_SUBDIR)
@${_+_}set -e; \
if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \
${ECHODIR} "===> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install})"; \
@@ -94,6 +95,7 @@ ${__target}_subdir_${__dir}: .MAKE
${MAKE} ${__target:realinstall=install} \
DIRPRFX=${DIRPRFX}$$edir/
.endif
+.endif
.endfor
${__target}: ${__subdir_targets}
.else
diff --git a/share/mk/bsd.test.mk b/share/mk/bsd.test.mk
index 406067701452..3453d94b9b27 100644
--- a/share/mk/bsd.test.mk
+++ b/share/mk/bsd.test.mk
@@ -27,6 +27,15 @@ TESTS_SUBDIRS?=
# List of variables to pass to the tests at run-time via the environment.
TESTS_ENV?=
+# Force all tests in a separate distribution file.
+#
+# We want this to be the case even when the distribution name is already
+# overriden. For example: we want the tests for programs in the 'games'
+# distribution to end up in the 'tests' distribution; the test programs
+# themselves have all the necessary logic to detect that the games are not
+# installed and thus won't cause false negatives.
+DISTRIBUTION:= tests
+
# Ordered list of directories to construct the PATH for the tests.
TESTS_PATH+= ${DESTDIR}/bin ${DESTDIR}/sbin \
${DESTDIR}/usr/bin ${DESTDIR}/usr/sbin