From 353735a95e1e4bcab4466b07c76b5f0f8792eff9 Mon Sep 17 00:00:00 2001 From: bluhm Date: Tue, 30 May 2017 15:36:13 +0000 Subject: [PATCH] Organize iked parser regress Makefile similar to mandoc dbm_dump. When object files from other parts of the tree are needed, build them there and symlink them into the regress obj directory. OK markus@ --- regress/sbin/iked/parser/Makefile | 39 +++++++++++++------------------ 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/regress/sbin/iked/parser/Makefile b/regress/sbin/iked/parser/Makefile index 7bd3b966b63..3424c7b77f6 100644 --- a/regress/sbin/iked/parser/Makefile +++ b/regress/sbin/iked/parser/Makefile @@ -1,37 +1,30 @@ -# $OpenBSD: Makefile,v 1.1 2017/05/29 20:59:28 markus Exp $ +# $OpenBSD: Makefile,v 1.2 2017/05/30 15:36:13 bluhm Exp $ WARNINGS=Yes -.include -.include - -.PATH: ${.CURDIR}/../../../../sbin/iked \ - ${.CURDIR}/../../../../sbin/iked/${__objdir} - PROG= test_parser -SRCS= tests.c common.c test_parser_fuzz.c ikev2_pld.c \ - imsg_util.c log.c util.c -SRCS+= ikev2_map.c eap_map.c +SRCS= tests.c common.c test_parser_fuzz.c +IKEOBJS= ikev2_pld.o imsg_util.o log.o util.o \ + ikev2_map.o eap_map.o +CLEANFILES= ${IKEOBJS} -LDADD= -lutil -lcrypto +LDADD+= -lutil -lcrypto ${IKEOBJS} DPADD+= ${LIBUTIL} ${LIBCRYPTO} CFLAGS+= -I${.CURDIR}/../../../../sbin/iked -CFLAGS+= -I${.CURDIR}/../../../../sbin/iked/${__objdir} CFLAGS+= -Wno-missing-field-initializers -CFLAGS+= -I${.CURDIR}/../test_helper +test_parser: ${IKEOBJS} -.if exists(${.CURDIR}/../test_helper/${__objdir}) -LDADD+=-L${.CURDIR}/../test_helper/${__objdir} -ltest_helper -DPADD+=${.CURDIR}/../test_helper/${__objdir}/libtest_helper.a -.else -LDADD+=-L${.CURDIR}/../test_helper -ltest_helper -DPADD+=${.CURDIR}/../test_helper/libtest_helper.a -.endif +${IKEOBJS}: + cd ${.CURDIR}/../../../../sbin/iked && make $@ + ln -sf ${.OBJDIR}/../../../../sbin/iked/$@ . -REGRESS_TARGETS=stamp-regress-${PROG} +LDADD+= -L${.OBJDIR} -ltest_helper +DPADD+= libtest_helper.a +CFLAGS+= -I${.CURDIR}/../test_helper -stamp-regress-${PROG}: ${PROG} - ./${PROG} && touch stamp-regress-${PROG} +libtest_helper.a: + cd ${.CURDIR}/../test_helper && make $@ + ln -sf ${.OBJDIR}/../test_helper/$@ . .include -- 2.20.1