1# $OpenBSD: Makefile,v 1.2 2015/04/07 01:27:07 guenther Exp $
2
3.include <bsd.obj.mk>
4
5AA_DIR=${.CURDIR}/../libaa
6AA_OBJDIR!=    if [ -d $(AA_DIR)/${__objdir} ]; then \
7                        echo "$(AA_DIR)/${__objdir}"; \
8                else \
9                        echo "$(AA_DIR)"; \
10                fi
11
12AB_DIR=${.CURDIR}/../libab
13AB_OBJDIR!=    if [ -d $(AB_DIR)/${__objdir} ]; then \
14                        echo "$(AB_DIR)/${__objdir}"; \
15                else \
16                        echo "$(AB_DIR)"; \
17                fi
18
19PROG=		pthread_atfork_test
20
21SRCS=		pthread_atfork_test.c
22
23CFLAGS+=	-DLIBAA="\"$(AA_OBJDIR)/libaa.so\""
24CFLAGS+=	-DLIBAB="\"$(AB_OBJDIR)/libab.so\""
25LDFLAGS+=	-Wl,-E
26
27LDADD+=		-lpthread
28DPADD+=		${LIBPTHREAD}
29
30NOMAN=
31
32CLEANFILES=	parent_out child_out
33
34TESTS=		0 1 2 3
35
36regress-pthread_atfork: ${PROG}
37	for i in ${TESTS}; do \
38		./${PROG} $$i || exit; \
39		printf "finished $$i\n\n"; \
40		printf "finished $$i\n\n" >&3; \
41	done >parent_out 3>child_out
42	cmp -s parent_out ${.CURDIR}/expected_parent.out
43	cmp -s child_out ${.CURDIR}/expected_child.out
44
45REGRESS_TARGETS=regress-pthread_atfork
46
47install:
48
49.include <bsd.regress.mk>
50