Makefile revision 1.9
1#	$NetBSD: Makefile,v 1.9 1999/01/10 02:54:12 castor Exp $
2
3PROG=	doexec
4NOMAN=	noman, no way, man
5
6LDSTATIC= -static		# only static compilation makes sense here
7
8.if (defined(DESTDIR))
9LDLIBS+= -lgcc -lc ${LIBCRTEND}
10GOODAOUT_LIB= -nostdlib -L${DESTDIR}/usr/lib ${LDSTATIC} 
11GOODAOUT_LIB+= ${LIBCRT0} ${LIBCRTBEGIN}
12.else
13GOODAOUT_LIB= ${LDSTATIC}
14.endif
15
16RP=	${.OBJDIR}/${PROG}
17TD=	${.CURDIR}/tests
18OD=	${.CURDIR}/good
19
20all:	${PROG} goodaout truncaout
21CLEANFILES+= goodaout truncaout
22
23regress:	test-empty test-nonexist \
24		test-nonexistshell test-devnullscript test-badinterplen \
25		test-goodscript test-scriptarg test-scriptarg-nospace \
26		test-goodaout test-truncaout
27
28test-empty:	${PROG} ${TD}/empty
29	${RP} ${TD}/empty | diff - ${OD}/empty
30
31test-nonexist:	${PROG}
32	${RP} ${TD}/nonexistent | diff - ${OD}/nonexistent
33
34test-nonexistshell: ${PROG} ${TD}/nonexistshell
35	${RP} ${TD}/nonexistshell | diff - ${OD}/nonexistshell
36
37test-devnullscript: ${PROG} ${TD}/devnullscript
38	${RP} ${TD}/devnullscript | diff - ${OD}/devnullscript
39
40test-badinterplen: ${PROG} ${TD}/badinterplen
41	${RP} ${TD}/badinterplen | diff - ${OD}/badinterplen
42
43test-goodscript: ${PROG} ${TD}/goodscript
44	${RP} ${TD}/goodscript | diff - ${OD}/goodscript
45
46test-scriptarg: ${PROG} ${TD}/scriptarg
47	${RP} ${TD}/scriptarg 2>&1 | diff - ${OD}/scriptarg
48
49test-scriptarg-nospace: ${PROG} ${TD}/scriptarg-nospace
50	${RP} ${TD}/scriptarg-nospace 2>&1 | diff - ${OD}/scriptarg-nospace
51
52goodaout: ${TD}/goodaout.c
53	${LINK.c} ${GOODAOUT_LIB} -o ${.TARGET} ${TD}/goodaout.c ${LDLIBS}
54
55test-goodaout: ${PROG} goodaout
56	${RP} ${.OBJDIR}/goodaout | diff - ${OD}/goodaout
57
58truncaout: goodaout
59	/bin/rm -rf truncaout
60	dd if=${.OBJDIR}/goodaout of=truncaout bs=16 count=1
61	chmod a+x truncaout
62
63test-truncaout: ${PROG} truncaout
64	${RP} ${.OBJDIR}/truncaout | diff - ${OD}/truncaout
65
66.include <bsd.prog.mk>
67