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