From: bluhm Date: Mon, 3 Jul 2017 18:19:55 +0000 (+0000) Subject: Generate source and header files for regress on demand. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1e1db3e52cc12ee33922385d32e703187ee6ad55;p=openbsd Generate source and header files for regress on demand. OK espie@ --- diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index 157aedf1df3..00f877d9fa5 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -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 index 00000000000..82fac466b6d --- /dev/null +++ b/regress/lib/libedit/Makefile.inc @@ -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 diff --git a/regress/lib/libedit/chared/Makefile b/regress/lib/libedit/chared/Makefile index 3d1e35c6d0e..ca502d07934 100644 --- a/regress/lib/libedit/chared/Makefile +++ b/regress/lib/libedit/chared/Makefile @@ -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 , 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 diff --git a/regress/lib/libedit/keymacro/Makefile b/regress/lib/libedit/keymacro/Makefile index f9e7ff24db8..5c95b094c25 100644 --- a/regress/lib/libedit/keymacro/Makefile +++ b/regress/lib/libedit/keymacro/Makefile @@ -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 , 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 diff --git a/regress/lib/libedit/read/Makefile b/regress/lib/libedit/read/Makefile index 416b822a3f9..86228ec0dca 100644 --- a/regress/lib/libedit/read/Makefile +++ b/regress/lib/libedit/read/Makefile @@ -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 , 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 index 00000000000..ba6c19daa0d --- /dev/null +++ b/regress/sbin/isakmpd/Makefile.inc @@ -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} diff --git a/regress/sbin/isakmpd/crypto/Makefile b/regress/sbin/isakmpd/crypto/Makefile index f0f8adcf552..a9e36091423 100644 --- a/regress/sbin/isakmpd/crypto/Makefile +++ b/regress/sbin/isakmpd/crypto/Makefile @@ -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 diff --git a/regress/sbin/isakmpd/dh/Makefile b/regress/sbin/isakmpd/dh/Makefile index 41dba838c45..f62dcb6ad96 100644 --- a/regress/sbin/isakmpd/dh/Makefile +++ b/regress/sbin/isakmpd/dh/Makefile @@ -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 diff --git a/regress/sbin/isakmpd/exchange/Makefile b/regress/sbin/isakmpd/exchange/Makefile index 13411897090..2f363b1da12 100644 --- a/regress/sbin/isakmpd/exchange/Makefile +++ b/regress/sbin/isakmpd/exchange/Makefile @@ -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 $ # @@ -29,10 +29,6 @@ # 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 diff --git a/regress/sbin/isakmpd/hmac/Makefile b/regress/sbin/isakmpd/hmac/Makefile index e906b4b89bc..dbf304ff254 100644 --- a/regress/sbin/isakmpd/hmac/Makefile +++ b/regress/sbin/isakmpd/hmac/Makefile @@ -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 diff --git a/regress/sbin/isakmpd/prf/Makefile b/regress/sbin/isakmpd/prf/Makefile index 79e07981d71..96e9d954326 100644 --- a/regress/sbin/isakmpd/prf/Makefile +++ b/regress/sbin/isakmpd/prf/Makefile @@ -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 diff --git a/regress/sbin/isakmpd/util/Makefile b/regress/sbin/isakmpd/util/Makefile index 9970247fa65..b9660d89706 100644 --- a/regress/sbin/isakmpd/util/Makefile +++ b/regress/sbin/isakmpd/util/Makefile @@ -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 diff --git a/regress/sbin/isakmpd/x509/Makefile b/regress/sbin/isakmpd/x509/Makefile index af44e8f1d35..d0f99bb8b00 100644 --- a/regress/sbin/isakmpd/x509/Makefile +++ b/regress/sbin/isakmpd/x509/Makefile @@ -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 diff --git a/sbin/isakmpd/Makefile b/sbin/isakmpd/Makefile index 594c7a2401d..7cdcdd26853 100644 --- a/sbin/isakmpd/Makefile +++ b/sbin/isakmpd/Makefile @@ -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} diff --git a/share/man/man5/bsd.regress.mk.5 b/share/man/man5/bsd.regress.mk.5 index 41b79cb89a3..7fb1b26c1c2 100644 --- a/share/man/man5/bsd.regress.mk.5 +++ b/share/man/man5/bsd.regress.mk.5 @@ -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