aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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