Home | History | Annotate | Line # | Download | only in execve
Makefile revision 1.12
      1  1.12  sommerfe #	$NetBSD: Makefile,v 1.12 1999/08/01 13:42:00 sommerfeld 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.9    castor LDLIBS+= -lgcc -lc ${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.1       cgd RP=	${.OBJDIR}/${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.11        is 	cp ${TD}/${x} ${.OBJDIR}
     29  1.11        is 	chmod +x ${.OBJDIR}/${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.1       cgd 
     39  1.11        is empty:	${TD}/empty
     40  1.11        is 	cp ${TD}/empty ${.OBJDIR}/empty
     41  1.11        is 	chmod +x ${.OBJDIR}/empty
     42  1.11        is 
     43  1.11        is test-empty:	${PROG} empty
     44  1.11        is 	${RP} ${.OBJDIR}/empty | diff - ${OD}/empty
     45   1.1       cgd 
     46   1.1       cgd test-nonexist:	${PROG}
     47   1.1       cgd 	${RP} ${TD}/nonexistent | diff - ${OD}/nonexistent
     48   1.1       cgd 
     49  1.11        is test-nonexistshell: ${PROG} nonexistshell
     50  1.11        is 	${RP} ${.OBJDIR}/nonexistshell | diff - ${OD}/nonexistshell
     51   1.1       cgd 
     52  1.11        is test-devnullscript: ${PROG} devnullscript
     53  1.11        is 	${RP} ${.OBJDIR}/devnullscript | diff - ${OD}/devnullscript
     54   1.1       cgd 
     55  1.11        is test-badinterplen: ${PROG} badinterplen
     56  1.11        is 	${RP} ${.OBJDIR}/badinterplen | diff - ${OD}/badinterplen
     57   1.1       cgd 
     58  1.11        is test-goodscript: ${PROG} goodscript
     59  1.11        is 	${RP} ${.OBJDIR}/goodscript | diff - ${OD}/goodscript
     60   1.1       cgd 
     61  1.11        is test-scriptarg: ${PROG} scriptarg
     62  1.11        is 	${RP} ${.OBJDIR}/scriptarg 2>&1 | diff - ${OD}/scriptarg
     63   1.1       cgd 
     64  1.11        is test-scriptarg-nospace: ${PROG} scriptarg-nospace
     65  1.11        is 	${RP} ${.OBJDIR}/scriptarg-nospace 2>&1 | diff - ${OD}/scriptarg-nospace
     66   1.1       cgd 
     67   1.1       cgd goodaout: ${TD}/goodaout.c
     68   1.7  wrstuden 	${LINK.c} ${GOODAOUT_LIB} -o ${.TARGET} ${TD}/goodaout.c ${LDLIBS}
     69   1.1       cgd 
     70   1.1       cgd test-goodaout: ${PROG} goodaout
     71   1.1       cgd 	${RP} ${.OBJDIR}/goodaout | diff - ${OD}/goodaout
     72   1.1       cgd 
     73   1.1       cgd truncaout: goodaout
     74   1.1       cgd 	/bin/rm -rf truncaout
     75   1.1       cgd 	dd if=${.OBJDIR}/goodaout of=truncaout bs=16 count=1
     76   1.1       cgd 	chmod a+x truncaout
     77   1.3     glass 
     78   1.1       cgd test-truncaout: ${PROG} truncaout
     79   1.1       cgd 	${RP} ${.OBJDIR}/truncaout | diff - ${OD}/truncaout
     80   1.1       cgd 
     81   1.1       cgd .include <bsd.prog.mk>
     82