xref: /openbsd/regress/sys/kern/execve/Makefile (revision 8b1f9e10)
1#	$OpenBSD: Makefile,v 1.5 2002/09/02 20:01:44 avsm Exp $
2
3PROG=	doexec
4LDSTATIC= -static
5
6RP=	${.OBJDIR}/${PROG}
7TD=	${.CURDIR}/tests
8OD=	${.CURDIR}/good
9
10TESTFILES= empty nonexistshell devnullscript badinterplen goodscript \
11	   scriptarg scriptarg-nospace goodaout truncaout
12
13CLEANFILES+= ${TESTFILES}
14
15all:	${PROG} ${TESTFILES}
16
17REGRESS_TARGETS=	test-empty test-nonexist \
18		test-nonexistshell test-devnullscript test-badinterplen \
19		test-goodscript test-scriptarg test-scriptarg-nospace \
20		test-goodaout test-truncaout
21
22empty: ${TD}/empty.in
23	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
24
25test-empty:	${PROG} empty
26	${RP} ${.OBJDIR}/empty | diff - ${OD}/empty
27
28nonexist: ${TD}/nonexist.in
29	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
30
31test-nonexist:	${PROG}
32	${RP} ${.OBJDIR}/nonexistent | diff - ${OD}/nonexistent
33
34nonexistshell: ${TD}/nonexistshell.in
35	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
36
37test-nonexistshell: ${PROG} nonexistshell
38	${RP} ${.OBJDIR}/nonexistshell | diff - ${OD}/nonexistshell
39
40devnullscript: ${TD}/devnullscript.in
41	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
42
43test-devnullscript: ${PROG} devnullscript
44	${RP} ${.OBJDIR}/devnullscript | diff - ${OD}/devnullscript
45
46badinterplen: ${TD}/badinterplen.in
47	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
48
49test-badinterplen: ${PROG} badinterplen
50	${RP} ${.OBJDIR}/badinterplen | diff - ${OD}/badinterplen
51
52goodscript: ${TD}/goodscript.in
53	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
54
55test-goodscript: ${PROG} goodscript
56	${RP} ${.OBJDIR}/goodscript | diff - ${OD}/goodscript
57
58scriptarg: ${TD}/scriptarg.in
59	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
60
61test-scriptarg: ${PROG} scriptarg
62	${RP} ${.OBJDIR}/scriptarg 2>&1 | diff - ${OD}/scriptarg
63
64scriptarg-nospace: ${TD}/scriptarg-nospace.in
65	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
66
67test-scriptarg-nospace: ${PROG} scriptarg-nospace
68	${RP} ${.OBJDIR}/scriptarg-nospace 2>&1 | diff - ${OD}/scriptarg-nospace
69
70goodaout: ${TD}/goodaout.c
71	${LINK.c} ${LDSTATIC} -o ${.TARGET} ${TD}/goodaout.c ${LDLIBS}
72
73test-goodaout: ${PROG} goodaout
74	${RP} ${.OBJDIR}/goodaout | diff - ${OD}/goodaout
75
76truncaout: goodaout
77	/bin/rm -rf truncaout
78	dd if=${.OBJDIR}/goodaout of=truncaout bs=16 count=1
79	chmod a+x truncaout
80
81test-truncaout: ${PROG} truncaout
82	${RP} ${.OBJDIR}/truncaout | diff - ${OD}/truncaout
83
84.include <bsd.regress.mk>
85