Makefile revision 1.16
11.16Stv#	$NetBSD: Makefile,v 1.16 2001/12/12 01:24:15 tv Exp $
21.1Scgd
31.16StvPROG=		doexec
41.16StvNOMAN=		# defined
51.16StvLDSTATIC=	-static		# only static compilation makes sense here
61.1Scgd
71.12Ssommerfe.include <bsd.own.mk>		# May define DESTDIR in mk.conf..
81.12Ssommerfe.if defined(DESTDIR)
91.16StvLDLIBS+=	-lgcc -lc -lgcc ${LIBCRTEND}
101.16StvGOODAOUT_LIB=	-nostdlib -L${DESTDIR}/usr/lib ${LDSTATIC} \
111.16Stv		${LIBCRT0} ${LIBCRTBEGIN}
121.7Swrstuden.else
131.16StvGOODAOUT_LIB=	${LDSTATIC}
141.7Swrstuden.endif
151.7Swrstuden
161.16StvRP=		./${PROG}
171.16StvTD=		${.CURDIR}/tests
181.16StvOD=		${.CURDIR}/good
191.1Scgd
201.16StvTESTSCRIPTS=	empty nonexistshell devnullscript badinterplen goodscript \
211.16Stv		scriptarg scriptarg-nospace
221.11Sis
231.16Stvall:		${PROG} goodaout truncaout ${TESTSCRIPTS}
241.11Sis
251.11Sis.for x in ${TESTSCRIPTS}
261.11Sis${x}: ${TD}/${x}
271.15Stv	cp ${TD}/${x} .
281.15Stv	chmod +x ${x}
291.11Sis.endfor
301.11Sis
311.16StvCLEANFILES+=	goodaout truncaout ${TESTSCRIPTS}
321.1Scgd
331.1Scgdregress:	test-empty test-nonexist \
341.1Scgd		test-nonexistshell test-devnullscript test-badinterplen \
351.1Scgd		test-goodscript test-scriptarg test-scriptarg-nospace \
361.1Scgd		test-goodaout test-truncaout
371.11Sis
381.11Sistest-empty:	${PROG} empty
391.15Stv	${RP} empty | diff - ${OD}/empty
401.1Scgd
411.1Scgdtest-nonexist:	${PROG}
421.1Scgd	${RP} ${TD}/nonexistent | diff - ${OD}/nonexistent
431.1Scgd
441.11Sistest-nonexistshell: ${PROG} nonexistshell
451.15Stv	${RP} nonexistshell | diff - ${OD}/nonexistshell
461.1Scgd
471.11Sistest-devnullscript: ${PROG} devnullscript
481.15Stv	${RP} devnullscript | diff - ${OD}/devnullscript
491.1Scgd
501.11Sistest-badinterplen: ${PROG} badinterplen
511.15Stv	${RP} badinterplen | diff - ${OD}/badinterplen
521.1Scgd
531.11Sistest-goodscript: ${PROG} goodscript
541.15Stv	${RP} goodscript | diff - ${OD}/goodscript
551.1Scgd
561.11Sistest-scriptarg: ${PROG} scriptarg
571.15Stv	${RP} scriptarg 2>&1 | diff - ${OD}/scriptarg
581.1Scgd
591.11Sistest-scriptarg-nospace: ${PROG} scriptarg-nospace
601.15Stv	${RP} scriptarg-nospace 2>&1 | diff - ${OD}/scriptarg-nospace
611.1Scgd
621.1Scgdgoodaout: ${TD}/goodaout.c
631.7Swrstuden	${LINK.c} ${GOODAOUT_LIB} -o ${.TARGET} ${TD}/goodaout.c ${LDLIBS}
641.1Scgd
651.1Scgdtest-goodaout: ${PROG} goodaout
661.15Stv	${RP} goodaout | diff - ${OD}/goodaout
671.1Scgd
681.1Scgdtruncaout: goodaout
691.1Scgd	/bin/rm -rf truncaout
701.15Stv	dd if=goodaout of=truncaout bs=16 count=1
711.1Scgd	chmod a+x truncaout
721.3Sglass
731.1Scgdtest-truncaout: ${PROG} truncaout
741.15Stv	${RP} truncaout | diff - ${OD}/truncaout
751.1Scgd
761.1Scgd.include <bsd.prog.mk>
77