1 1.15 tv # $NetBSD: Makefile,v 1.15 2001/10/31 15:57:56 tv Exp $ 2 1.1 cgd 3 1.1 cgd PROG= doexec 4 1.10 lukem MKMAN= no 5 1.1 cgd 6 1.6 cgd LDSTATIC= -static # only static compilation makes sense here 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.13 enami LDLIBS+= -lgcc -lc -lgcc ${LIBCRTEND} 11 1.9 castor GOODAOUT_LIB= -nostdlib -L${DESTDIR}/usr/lib ${LDSTATIC} 12 1.9 castor GOODAOUT_LIB+= ${LIBCRT0} ${LIBCRTBEGIN} 13 1.7 wrstuden .else 14 1.7 wrstuden GOODAOUT_LIB= ${LDSTATIC} 15 1.7 wrstuden .endif 16 1.7 wrstuden 17 1.15 tv RP= ./${PROG} 18 1.1 cgd TD= ${.CURDIR}/tests 19 1.1 cgd OD= ${.CURDIR}/good 20 1.1 cgd 21 1.11 is TESTSCRIPTS=empty nonexistshell devnullscript badinterplen goodscript \ 22 1.11 is scriptarg scriptarg-nospace 23 1.11 is 24 1.11 is 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.11 is 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.15 tv ${RP} empty | diff - ${OD}/empty 41 1.1 cgd 42 1.1 cgd test-nonexist: ${PROG} 43 1.1 cgd ${RP} ${TD}/nonexistent | diff - ${OD}/nonexistent 44 1.1 cgd 45 1.11 is test-nonexistshell: ${PROG} nonexistshell 46 1.15 tv ${RP} nonexistshell | diff - ${OD}/nonexistshell 47 1.1 cgd 48 1.11 is test-devnullscript: ${PROG} devnullscript 49 1.15 tv ${RP} devnullscript | diff - ${OD}/devnullscript 50 1.1 cgd 51 1.11 is test-badinterplen: ${PROG} badinterplen 52 1.15 tv ${RP} badinterplen | diff - ${OD}/badinterplen 53 1.1 cgd 54 1.11 is test-goodscript: ${PROG} goodscript 55 1.15 tv ${RP} goodscript | diff - ${OD}/goodscript 56 1.1 cgd 57 1.11 is test-scriptarg: ${PROG} scriptarg 58 1.15 tv ${RP} scriptarg 2>&1 | diff - ${OD}/scriptarg 59 1.1 cgd 60 1.11 is test-scriptarg-nospace: ${PROG} scriptarg-nospace 61 1.15 tv ${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.15 tv ${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.15 tv ${RP} truncaout | diff - ${OD}/truncaout 76 1.1 cgd 77 1.1 cgd .include <bsd.prog.mk> 78