aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2017-08-02 03:18:24 +0000
committerEnji Cooper <ngie@FreeBSD.org>2017-08-02 03:18:24 +0000
commit5e291c3faf37cc6fa065555c34041e5e67838a83 (patch)
tree4fbfe2720951b4e8c63b3f8aed267d196f9889d4
parentfee25c68476f9120a2ce612722dcf024ab41effd (diff)
downloadsrc-5e291c3faf37cc6fa065555c34041e5e67838a83.tar.gz
src-5e291c3faf37cc6fa065555c34041e5e67838a83.zip
Hook HAS_TESTS (r321901) in to bsd.lib.mk and bsd.prog.mk
Apply the required sugar to make "make check" just work (tm) when invoked from a subdirectory where HAS_TESTS is defined in the relevant Makefile. Adjust $LD_LIBRARY_PATH and $PATH appropriately from bsd.lib.mk and bsd.prog.mk to make the "user experience" more out of the box/seamless.
Notes
Notes: svn path=/projects/make-check-sandbox/; revision=321903
-rw-r--r--share/mk/bsd.lib.mk6
-rw-r--r--share/mk/bsd.prog.mk7
2 files changed, 13 insertions, 0 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 67a5630996be..6005d8c1651d 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -442,6 +442,12 @@ OBJS_DEPEND_GUESS.${_S:R}.pico+= ${_S}
.endfor
.endif
+.if defined(HAS_TESTS)
+MAKE+= -D_TESTS_USE_OBJDIR
+SUBDIR_TARGETS+= check
+TESTS_LD_LIBRARY_PATH+= ${.OBJDIR}
+.endif
+
.include <bsd.dep.mk>
.include <bsd.clang-analyze.mk>
.include <bsd.obj.mk>
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index b107ad7d2198..3894b369e6c5 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -305,6 +305,13 @@ lint: ${SRCS:M*.c}
.include <bsd.man.mk>
.endif
+.if defined(HAS_TESTS)
+MAKE+= -D_TESTS_USE_OBJDIR
+SUBDIR_TARGETS+= check
+TESTS_LD_LIBRARY_PATH+= ${.OBJDIR}
+TESTS_PATH+= ${.OBJDIR}
+.endif
+
.if defined(PROG)
OBJS_DEPEND_GUESS+= ${SRCS:M*.h}
.endif