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