Makefile revision 1.15
11.15Stv#	$NetBSD: Makefile,v 1.15 2001/10/31 15:57:56 tv Exp $
21.1Scgd
31.1ScgdPROG=	doexec
41.10SlukemMKMAN=	no
51.1Scgd
61.6ScgdLDSTATIC= -static		# only static compilation makes sense here
71.1Scgd
81.12Ssommerfe.include <bsd.own.mk>		# May define DESTDIR in mk.conf..
91.12Ssommerfe.if defined(DESTDIR)
101.13SenamiLDLIBS+= -lgcc -lc -lgcc ${LIBCRTEND}
111.9ScastorGOODAOUT_LIB= -nostdlib -L${DESTDIR}/usr/lib ${LDSTATIC} 
121.9ScastorGOODAOUT_LIB+= ${LIBCRT0} ${LIBCRTBEGIN}
131.7Swrstuden.else
141.7SwrstudenGOODAOUT_LIB= ${LDSTATIC}
151.7Swrstuden.endif
161.7Swrstuden
171.15StvRP=	./${PROG}
181.1ScgdTD=	${.CURDIR}/tests
191.1ScgdOD=	${.CURDIR}/good
201.1Scgd
211.11SisTESTSCRIPTS=empty nonexistshell devnullscript badinterplen goodscript \
221.11Sis	scriptarg scriptarg-nospace
231.11Sis
241.11Sisall:	${PROG} goodaout truncaout ${TESTSCRIPTS}
251.11Sis
261.11Sis.for x in ${TESTSCRIPTS}
271.11Sis${x}: ${TD}/${x}
281.15Stv	cp ${TD}/${x} .
291.15Stv	chmod +x ${x}
301.11Sis.endfor
311.11Sis
321.11SisCLEANFILES+= goodaout truncaout ${TESTSCRIPTS}
331.1Scgd
341.1Scgdregress:	test-empty test-nonexist \
351.1Scgd		test-nonexistshell test-devnullscript test-badinterplen \
361.1Scgd		test-goodscript test-scriptarg test-scriptarg-nospace \
371.1Scgd		test-goodaout test-truncaout
381.11Sis
391.11Sistest-empty:	${PROG} empty
401.15Stv	${RP} empty | diff - ${OD}/empty
411.1Scgd
421.1Scgdtest-nonexist:	${PROG}
431.1Scgd	${RP} ${TD}/nonexistent | diff - ${OD}/nonexistent
441.1Scgd
451.11Sistest-nonexistshell: ${PROG} nonexistshell
461.15Stv	${RP} nonexistshell | diff - ${OD}/nonexistshell
471.1Scgd
481.11Sistest-devnullscript: ${PROG} devnullscript
491.15Stv	${RP} devnullscript | diff - ${OD}/devnullscript
501.1Scgd
511.11Sistest-badinterplen: ${PROG} badinterplen
521.15Stv	${RP} badinterplen | diff - ${OD}/badinterplen
531.1Scgd
541.11Sistest-goodscript: ${PROG} goodscript
551.15Stv	${RP} goodscript | diff - ${OD}/goodscript
561.1Scgd
571.11Sistest-scriptarg: ${PROG} scriptarg
581.15Stv	${RP} scriptarg 2>&1 | diff - ${OD}/scriptarg
591.1Scgd
601.11Sistest-scriptarg-nospace: ${PROG} scriptarg-nospace
611.15Stv	${RP} scriptarg-nospace 2>&1 | diff - ${OD}/scriptarg-nospace
621.1Scgd
631.1Scgdgoodaout: ${TD}/goodaout.c
641.7Swrstuden	${LINK.c} ${GOODAOUT_LIB} -o ${.TARGET} ${TD}/goodaout.c ${LDLIBS}
651.1Scgd
661.1Scgdtest-goodaout: ${PROG} goodaout
671.15Stv	${RP} goodaout | diff - ${OD}/goodaout
681.1Scgd
691.1Scgdtruncaout: goodaout
701.1Scgd	/bin/rm -rf truncaout
711.15Stv	dd if=goodaout of=truncaout bs=16 count=1
721.1Scgd	chmod a+x truncaout
731.3Sglass
741.1Scgdtest-truncaout: ${PROG} truncaout
751.15Stv	${RP} truncaout | diff - ${OD}/truncaout
761.1Scgd
771.1Scgd.include <bsd.prog.mk>
78