Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / regress / sys / kern / execve / Makefile
blobde1eb32975f6479b9c54beaf648dd192c83b6a68
1 # $NetBSD: Makefile,v 1.17 2002/09/18 05:41:53 lukem Exp $
3 NOMAN= # defined
4 LDSTATIC= -static # only static compilation makes sense here
6 PROG= doexec
8 .include <bsd.own.mk> # May define DESTDIR in mk.conf..
9 .if defined(DESTDIR)
10 LDLIBS+= -lgcc -lc -lgcc ${LIBCRTEND}
11 GOODAOUT_LIB= -nostdlib -L${DESTDIR}/usr/lib ${LDSTATIC} \
12 ${LIBCRT0} ${LIBCRTBEGIN}
13 .else
14 GOODAOUT_LIB= ${LDSTATIC}
15 .endif
17 RP= ./${PROG}
18 TD= ${.CURDIR}/tests
19 OD= ${.CURDIR}/good
21 TESTSCRIPTS= empty nonexistshell devnullscript badinterplen goodscript \
22 scriptarg scriptarg-nospace
24 all: ${PROG} goodaout truncaout ${TESTSCRIPTS}
26 .for x in ${TESTSCRIPTS}
27 ${x}: ${TD}/${x}
28 cp ${TD}/${x} .
29 chmod +x ${x}
30 .endfor
32 CLEANFILES+= goodaout truncaout ${TESTSCRIPTS}
34 regress: test-empty test-nonexist \
35 test-nonexistshell test-devnullscript test-badinterplen \
36 test-goodscript test-scriptarg test-scriptarg-nospace \
37 test-goodaout test-truncaout
39 test-empty: ${PROG} empty
40 ${RP} empty | diff ${OD}/empty -
42 test-nonexist: ${PROG}
43 ${RP} ${TD}/nonexistent | diff ${OD}/nonexistent -
45 test-nonexistshell: ${PROG} nonexistshell
46 ${RP} nonexistshell | diff ${OD}/nonexistshell -
48 test-devnullscript: ${PROG} devnullscript
49 ${RP} devnullscript | diff ${OD}/devnullscript -
51 test-badinterplen: ${PROG} badinterplen
52 ${RP} badinterplen | diff ${OD}/badinterplen -
54 test-goodscript: ${PROG} goodscript
55 ${RP} goodscript | diff ${OD}/goodscript -
57 test-scriptarg: ${PROG} scriptarg
58 ${RP} scriptarg 2>&1 | diff ${OD}/scriptarg -
60 test-scriptarg-nospace: ${PROG} scriptarg-nospace
61 ${RP} scriptarg-nospace 2>&1 | diff ${OD}/scriptarg-nospace -
63 goodaout: ${TD}/goodaout.c
64 ${LINK.c} ${GOODAOUT_LIB} -o ${.TARGET} ${TD}/goodaout.c ${LDLIBS}
66 test-goodaout: ${PROG} goodaout
67 ${RP} goodaout | diff ${OD}/goodaout -
69 truncaout: goodaout
70 /bin/rm -rf truncaout
71 dd if=goodaout of=truncaout bs=16 count=1
72 chmod a+x truncaout
74 test-truncaout: ${PROG} truncaout
75 ${RP} truncaout | diff ${OD}/truncaout -
77 .include <bsd.prog.mk>