Generate source and header files for regress on demand.
authorbluhm <bluhm@openbsd.org>
Mon, 3 Jul 2017 18:19:55 +0000 (18:19 +0000)
committerbluhm <bluhm@openbsd.org>
Mon, 3 Jul 2017 18:19:55 +0000 (18:19 +0000)
OK espie@

15 files changed:
lib/libedit/Makefile
regress/lib/libedit/Makefile.inc [new file with mode: 0644]
regress/lib/libedit/chared/Makefile
regress/lib/libedit/keymacro/Makefile
regress/lib/libedit/read/Makefile
regress/sbin/isakmpd/Makefile.inc [new file with mode: 0644]
regress/sbin/isakmpd/crypto/Makefile
regress/sbin/isakmpd/dh/Makefile
regress/sbin/isakmpd/exchange/Makefile
regress/sbin/isakmpd/hmac/Makefile
regress/sbin/isakmpd/prf/Makefile
regress/sbin/isakmpd/util/Makefile
regress/sbin/isakmpd/x509/Makefile
sbin/isakmpd/Makefile
share/man/man5/bsd.regress.mk.5

index 157aedf..00f877d 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.27 2017/06/16 10:25:54 espie Exp $
+#      $OpenBSD: Makefile,v 1.28 2017/07/03 18:19:55 bluhm Exp $
 #      $NetBSD: Makefile,v 1.41 2010/02/03 15:34:43 roy Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/4/93
 
@@ -28,13 +28,15 @@ CPPFLAGS+=-I. -I${.CURDIR}
 AHDR=vi.h emacs.h common.h
 ASRC=${LIBEDITDIR}/vi.c ${LIBEDITDIR}/emacs.c ${LIBEDITDIR}/common.c
 
-CLEANFILES+=   ${AHDR} fcns.h func.h help.h
+GENERATED=     ${AHDR} fcns.h func.h help.h
+CLEANFILES+=   ${GENERATED}
 
 #SUBDIR+=      readline
 HOST_SH=       sh
 
-.depend: ${AHDR} fcns.h func.h help.h
-BUILDFIRST = ${AHDR} fcns.h func.h help.h
+.PHONY: generated
+.depend generated: ${GENERATED}
+BUILDFIRST = ${GENERATED}
 
 vi.h: vi.c makelist
        ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c \
diff --git a/regress/lib/libedit/Makefile.inc b/regress/lib/libedit/Makefile.inc
new file mode 100644 (file)
index 0000000..82fac46
--- /dev/null
@@ -0,0 +1,12 @@
+#      $OpenBSD: Makefile.inc,v 1.1 2017/07/03 18:19:55 bluhm Exp $
+
+TOPSRC=                ${.CURDIR}/../../../../lib/libedit
+TOPOBJ!!=      ${MAKE} -C ${TOPSRC} -V .OBJDIR
+CLAGS+=                -I${TOPSRC} -I${TOPOBJ}
+
+.PHONY: generated
+
+${PROG}: generated
+
+generated:
+       ${MAKE} -C ${TOPSRC} generated
index 3d1e35c..ca502d0 100644 (file)
@@ -1,20 +1,12 @@
-#      $OpenBSD: Makefile,v 1.3 2016/09/18 21:06:46 bluhm Exp $
+#      $OpenBSD: Makefile,v 1.4 2017/07/03 18:19:55 bluhm Exp $
 #
 # Author: Ingo Schwarze <schwarze@openbsd.org>, 2016.  Public Domain.
 
 REGRESS_TARGETS = gets
 
 PROG =         test_gets
-CPPFLAGS +=    -I${.CURDIR}/../../../../lib/libedit
-CPPFLAGS +=    -I${.OBJDIR}/../../../../lib/libedit
-MAN =
 CLEANFILES +=  out_gets.utf8 out_gets.ascii
 
-depend:
-       cd ${.CURDIR}/../../../../lib/libedit && make depend
-${PROG}: depend
-regress: ${PROG}
-
 gets:
        LC_ALL=en_US.UTF-8 ./test_gets < ${.CURDIR}/inp_gets.txt > out_gets.utf8
        diff -au ${.CURDIR}/exp_gets.utf8 out_gets.utf8
index f9e7ff2..5c95b09 100644 (file)
@@ -1,15 +1,7 @@
-#      $OpenBSD: Makefile,v 1.3 2016/09/18 21:06:46 bluhm Exp $
+#      $OpenBSD: Makefile,v 1.4 2017/07/03 18:19:55 bluhm Exp $
 #
 # Author: Ingo Schwarze <schwarze@openbsd.org>, 2016.  Public Domain.
 
 PROG =         test_get
-CPPFLAGS +=    -I${.CURDIR}/../../../../lib/libedit
-CPPFLAGS +=    -I${.OBJDIR}/../../../../lib/libedit
-MAN =
-
-depend:
-       cd ${.CURDIR}/../../../../lib/libedit && make depend
-${PROG}: depend
-regress: ${PROG}
 
 .include <bsd.regress.mk>
index 416b822..86228ec 100644 (file)
@@ -1,20 +1,17 @@
-#      $OpenBSD: Makefile,v 1.5 2016/09/18 21:06:46 bluhm Exp $
+#      $OpenBSD: Makefile,v 1.6 2017/07/03 18:19:55 bluhm Exp $
 #
 # Author: Ingo Schwarze <schwarze@openbsd.org>, 2016.  Public Domain.
 
 REGRESS_TARGETS = getcmd read_char
 
-CPPFLAGS +=    -I${.CURDIR}/../../../../lib/libedit
-CPPFLAGS +=    -I${.OBJDIR}/../../../../lib/libedit
 CLEANFILES +=  test_read_char test_getcmd out_getcmd.txt
 
-depend:
-       cd ${.CURDIR}/../../../../lib/libedit && make depend
+test_read_char test_getcmd: generated
 
-read_char: depend test_read_char
+read_char: test_read_char
        sh ${.CURDIR}/test_read_char.sh
 
-getcmd: depend test_getcmd
+getcmd: test_getcmd
        echo -n s | ./test_getcmd > out_getcmd.txt
        diff -u ${.CURDIR}/exp_getcmd.txt out_getcmd.txt
 
diff --git a/regress/sbin/isakmpd/Makefile.inc b/regress/sbin/isakmpd/Makefile.inc
new file mode 100644 (file)
index 0000000..ba6c19d
--- /dev/null
@@ -0,0 +1,16 @@
+#      $OpenBSD: Makefile.inc,v 1.1 2017/07/03 18:19:55 bluhm Exp $
+
+TOPSRC=                ${.CURDIR}/../../../../sbin/isakmpd
+TOPOBJ!!=      ${MAKE} -C ${TOPSRC} -V .OBJDIR
+CFLAGS+=       -I${TOPSRC} -I${TOPSRC}/sysdep/openbsd -I${TOPOBJ} -Wall
+DEBUG=         -g
+
+.PHONY: generated
+
+${PROG}: generated
+
+generated:
+       ${MAKE} -C ${TOPSRC} generated
+
+.PATH:         ${.CURDIR}/../common
+.PATH:         ${TOPSRC} ${TOPSRC}/sysdep/openbsd ${TOPOBJ}
index f0f8adc..a9e3609 100644 (file)
@@ -1,27 +1,13 @@
-#      $OpenBSD: Makefile,v 1.4 2016/09/03 10:56:58 bluhm Exp $
+#      $OpenBSD: Makefile,v 1.5 2017/07/03 18:19:55 bluhm Exp $
 #      $EOM: Makefile,v 1.7 2000/03/28 21:22:06 ho Exp $
 
 # Test Crypto:
 
 PROG=          cryptotest
 SRCS=          crypto.c cryptotest.c conf.c log.c monitor.c util.c
-TOPSRC=                ${.CURDIR}/../../../../sbin/isakmpd
-TOPOBJ!=       cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f-
-.PATH:         ${.CURDIR}/../common
-.PATH:         ${TOPSRC} ${TOPSRC}/sysdep/openbsd ${TOPOBJ}
-CFLAGS+=       -I${TOPSRC} -I${TOPSRC}/sysdep/openbsd -I${TOPOBJ} -Wall \
-               -DUSE_TRIPLEDES -DUSE_CAST -DUSE_BLOWFISH -DUSE_DES \
+CFLAGS+=       -DUSE_TRIPLEDES -DUSE_CAST -DUSE_BLOWFISH -DUSE_DES \
                -DUSE_AES
 LDADD+=                -lcrypto
 DPADD+=                ${LIBCRYPTO}
-NOMAN=
-DEBUG=         -g
-
-.PHONY:        isakmpd-depend
-
-all regress: isakmpd-depend
-
-isakmpd-depend:
-       cd ${TOPSRC} && ${MAKE} depend
 
 .include <bsd.regress.mk>
index 41dba83..f62dcb6 100644 (file)
@@ -1,21 +1,15 @@
-#      $OpenBSD: Makefile,v 1.2 2010/06/29 19:50:16 reyk Exp $
+#      $OpenBSD: Makefile,v 1.3 2017/07/03 18:19:55 bluhm Exp $
 #      $EOM: Makefile,v 1.10 2000/04/07 20:19:43 niklas Exp $
 
 # Test DH:
 
 PROG=          dhtest
 SRCS=          dh.c dhtest.c
-TOPSRC=                ${.CURDIR}/../../../../sbin/isakmpd
-TOPOBJ!=       cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f-
 OS!=           awk '/^OS=/ { print $$2 }' ${.CURDIR}/../../Makefile
 FEATURES!=     awk '/^FEATURES=/ { print $$0 }' ${.CURDIR}/../../Makefile | sed 's/FEATURES=.//'
-.PATH:         ${TOPSRC} ${TOPSRC}/sysdep/openbsd ${TOPOBJ}
-CFLAGS+=       -I${TOPSRC} -I${TOPSRC}/sysdep/openbsd -I${TOPOBJ} -Wall \
-               -DUSE_EC
-NOMAN=
+CFLAGS+=       -DUSE_EC
 LDADD+=                -lcrypto
 DPADD+=                ${LIBCRYPTO}
-DEBUG=         -g
 
 .if ${FEATURES:Mgmp} == "gmp"
 CFLAGS+=       -DMP_FLAVOUR=MP_FLAVOUR_GMP
index 1341189..2f363b1 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.1 2005/04/08 17:12:49 cloder Exp $
+#      $OpenBSD: Makefile,v 1.2 2017/07/03 18:19:55 bluhm Exp $
 #      $EOM: Makefile,v 1.8 2000/03/28 21:22:07 ho Exp $
 
 #
 # This code was written under funding by Ericsson Radio Systems.
 #
 
-TOPSRC=                ${.CURDIR}/../../../../sbin/isakmpd
-TOPOBJ!=       cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f-
-.PATH:         ${TOPSRC} ${TOPSRC}/sysdep/openbsd ${TOPOBJ}
-CFLAGS+=       -I${TOPSRC} -I${TOPSRC}/sysdep/openbsd -I${TOPOBJ} -Wall
 RUN=           ${SUDO} env ISAKMPD=${TOPOBJ}/isakmpd sh ${.CURDIR}/run.sh
 
 TESTS=         def
index e906b4b..dbf304f 100644 (file)
@@ -1,23 +1,9 @@
-#      $OpenBSD: Makefile,v 1.3 2016/09/03 10:56:58 bluhm Exp $
+#      $OpenBSD: Makefile,v 1.4 2017/07/03 18:19:55 bluhm Exp $
 #      $EOM: Makefile,v 1.3 1999/02/25 15:14:24 niklas Exp $
 
 # Test HMAC:
 
 PROG=          hmactest
 SRCS=          hash.c hmactest.c conf.c log.c monitor.c util.c
-TOPSRC=                ${.CURDIR}/../../../../sbin/isakmpd
-TOPOBJ!=       cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f-
-.PATH:         ${.CURDIR}/../common
-.PATH:         ${TOPSRC} ${TOPSRC}/sysdep/openbsd ${TOPOBJ}
-CFLAGS+=       -I${TOPSRC} -I${TOPSRC}/sysdep/openbsd -I${TOPOBJ} -Wall
-NOMAN=
-DEBUG=         -g
-
-.PHONY:        isakmpd-depend
-
-all regress: isakmpd-depend
-
-isakmpd-depend:
-       cd ${TOPSRC} && ${MAKE} depend
 
 .include <bsd.regress.mk>
index 79e0798..96e9d95 100644 (file)
@@ -1,23 +1,9 @@
-#      $OpenBSD: Makefile,v 1.3 2016/09/03 10:56:58 bluhm Exp $
+#      $OpenBSD: Makefile,v 1.4 2017/07/03 18:19:55 bluhm Exp $
 #      $EOM: Makefile,v 1.6 2000/03/28 21:22:07 ho Exp $
 
 # Test PRF:
 
 PROG=          prftest
 SRCS=          prf.c hash.c log.c prftest.c conf.c monitor.c util.c
-TOPSRC=                ${.CURDIR}/../../../../sbin/isakmpd
-TOPOBJ!=       cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f-
-.PATH:         ${.CURDIR}/../common
-.PATH:         ${TOPSRC} ${TOPSRC}/sysdep/openbsd ${TOPOBJ}
-CFLAGS+=       -I${TOPSRC} -I${TOPSRC}/sysdep/openbsd -I${TOPOBJ} -Wall
-NOMAN=
-DEBUG=         -g
-
-.PHONY:        isakmpd-depend
-
-all regress: isakmpd-depend
-
-isakmpd-depend:
-       cd ${TOPSRC} && ${MAKE} depend
 
 .include <bsd.regress.mk>
index 9970247..b9660d8 100644 (file)
@@ -1,22 +1,8 @@
-#      $OpenBSD: Makefile,v 1.3 2016/09/03 10:56:58 bluhm Exp $
+#      $OpenBSD: Makefile,v 1.4 2017/07/03 18:19:55 bluhm Exp $
 
 # Test some utility functions
 
 PROG=          utiltest
 SRCS=          log.c util.c utiltest.c conf.c monitor.c
-TOPSRC=                ${.CURDIR}/../../../../sbin/isakmpd
-TOPOBJ!=       cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f-
-.PATH:         ${.CURDIR}/../common
-.PATH:         ${TOPSRC} ${TOPSRC}/sysdep/openbsd ${TOPOBJ}
-CFLAGS+=       -I${TOPSRC} -I${TOPSRC}/sysdep/openbsd -I${TOPOBJ} -Wall
-NOMAN=
-DEBUG=         -g
-
-.PHONY:        isakmpd-depend
-
-all regress: isakmpd-depend
-
-isakmpd-depend:
-       cd ${TOPSRC} && ${MAKE} depend
 
 .include <bsd.regress.mk>
index af44e8f..d0f99bb 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.1 2005/04/08 17:12:50 cloder Exp $
+#      $OpenBSD: Makefile,v 1.2 2017/07/03 18:19:55 bluhm Exp $
 #      $EOM: Makefile,v 1.16 2000/09/28 12:53:27 niklas Exp $
 
 #
@@ -39,14 +39,8 @@ PROG=                x509test
 SRCS=          x509test.c conf.c log.c libcrypto.c sysdep.c field.c util.c \
                isakmp_fld.c ipsec_fld.c ipsec_num.c isakmp_num.c constants.c \
                cert.c
-TOPSRC=                ${.CURDIR}/../../../../sbin/isakmpd
-TOPOBJ!=       cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f-
 OS!=           awk '/^OS=/ { print $$2 }' ${.CURDIR}/../../Makefile
 FEATURES!=     awk '/^FEATURES=/ { print $$0 }' ${TOPSRC}/Makefile | sed 's/FEATURES=.//'
-.PATH:         ${TOPSRC} ${TOPSRC}/sysdep/openbsd ${TOPOBJ}
-CFLAGS+=       -I${TOPSRC} -I${TOPSRC}/sysdep/openbsd -I${TOPOBJ} -Wall
-NOMAN=
-DEBUG=         -g
 
 .if ${FEATURES:Mgmp} == "gmp"
 CFLAGS+=       -DMP_FLAVOUR=MP_FLAVOUR_GMP
@@ -56,8 +50,6 @@ DPADD+=               ${LIBGMP}
 CFLAGS+=       -DMP_FLAVOUR=MP_FLAVOUR_OPENSSL
 .endif
 
-.include "${TOPSRC}/sysdep/openbsd/Makefile.sysdep"
-
 X509=          x509.c
 POLICY=                policy.c
 
index 594c7a2..7cdcdd2 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.86 2017/06/16 10:25:54 espie Exp $
+#      $OpenBSD: Makefile,v 1.87 2017/07/03 18:19:55 bluhm Exp $
 #      $EOM: Makefile,v 1.78 2000/10/15 21:33:42 niklas Exp $
 
 #
@@ -81,7 +81,8 @@ isakmp_fld.c isakmp_fld.h: genfields.sh isakmp_fld.fld
 isakmp_num.c isakmp_num.h: genconstants.sh isakmp_num.cst
        /bin/sh ${.CURDIR}/genconstants.sh ${.CURDIR}/isakmp_num
 
-${PROG} beforedepend: ${GENERATED}
+.PHONY: generated
+${PROG} beforedepend generated: ${GENERATED}
 
 BUILDFIRST = ${GENERATED}
 
index 41b79cb..7fb1b26 100644 (file)
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bsd.regress.mk.5,v 1.13 2017/05/30 12:14:38 jmc Exp $
+.\" $OpenBSD: bsd.regress.mk.5,v 1.14 2017/07/03 18:19:55 bluhm Exp $
 .\"
 .\" Copyright (c) 2002 Anil Madhavapeddy
 .\" Copyright (c) 2000 Marc Espie
@@ -25,7 +25,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd $Mdocdate: May 30 2017 $
+.Dd $Mdocdate: July 3 2017 $
 .Dt BSD.REGRESS.MK 5
 .Os
 .Sh NAME
@@ -184,6 +184,9 @@ The test must not assume that they have already been built, but
 should run
 .Sy make
 in the appropriate source directory as a dependency.
+For missing generated source or header files a target called
+.Sy make Cm generated
+is common.
 The
 .Pa /usr/src/
 tree can be found with a relative path or with the