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