use SUBDIR to recuse into unit tests; makes "make obj" actually
authordjm <djm@openbsd.org>
Tue, 20 Jan 2015 22:58:57 +0000 (22:58 +0000)
committerdjm <djm@openbsd.org>
Tue, 20 Jan 2015 22:58:57 +0000 (22:58 +0000)
work

regress/usr.bin/ssh/Makefile
regress/usr.bin/ssh/unittests/test_helper/Makefile

index ad415b7..ba02e04 100644 (file)
@@ -1,7 +1,11 @@
-#      $OpenBSD: Makefile,v 1.76 2015/01/18 22:00:18 djm Exp $
+#      $OpenBSD: Makefile,v 1.77 2015/01/20 22:58:57 djm Exp $
 
-REGRESS_FAIL_EARLY= yes
-REGRESS_TARGETS=       unit t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12
+.ifndef SKIP_UNIT
+SUBDIR=                unittests
+.endif
+
+REGRESS_FAIL_EARLY=    yes
+REGRESS_TARGETS=       t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12
 
 CLEANFILES+=   t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \
                t8.out t8.out.pub t9.out t9.out.pub t10.out t10.out.pub \
@@ -90,11 +94,6 @@ SUDO_CLEAN+= /var/run/testdata_${USER} /var/run/keycommand_${USER}
 # Enable all malloc(3) randomisations and checks
 TEST_ENV=      "MALLOC_OPTIONS=AFGJPRX"
 
-unit:
-       if test -z "${SKIP_UNIT}" ; then \
-               (set -e ; cd ${.CURDIR}/unittests ; make) \
-       fi
-
 t1:
        ssh-keygen -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv
        tr '\n' '\r' <${.CURDIR}/rsa_ssh2.prv > ${.OBJDIR}/rsa_ssh2_cr.prv
@@ -189,6 +188,5 @@ clean:
        rm -f ${CLEANFILES}
        test -z "${SUDO}" || ${SUDO} rm -f ${SUDO_CLEAN}
        rm -rf .putty
-       (set -e ; cd ${.CURDIR}/unittests ; make clean)
 
 .include <bsd.regress.mk>
index 3e90903..5b3894c 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.1 2014/04/30 05:32:00 djm Exp $
+#      $OpenBSD: Makefile,v 1.2 2015/01/20 22:58:57 djm Exp $
 
 LIB=   test_helper
 SRCS=  test_helper.c fuzz.c
@@ -7,6 +7,9 @@ DEBUGLIBS= no
 NOPROFILE= yes
 NOPIC= yes
 
+# Hack to allow building with SUBDIR in ../../Makefile
+regress: all
+
 install:
        @echo -n