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