Home | History | Annotate | Line # | Download | only in mk
bsd.test.mk revision 1.7
      1 # $NetBSD: bsd.test.mk,v 1.7 2008/05/01 15:36:36 jmmv Exp $
      2 #
      3 
      4 .include <bsd.init.mk>
      5 
      6 TESTSBASE=	/usr/tests
      7 
      8 _TESTS=		# empty
      9 
     10 .if defined(TESTS_C)
     11 PROGS+=		${TESTS_C}
     12 LDADD+=		-latf-c
     13 .  for _T in ${TESTS_C}
     14 BINDIR.${_T}=	${TESTSDIR}
     15 MAN.${_T}?=	# empty
     16 _TESTS+=	${_T}
     17 .  endfor
     18 .endif
     19 
     20 .if defined(TESTS_CXX)
     21 PROGS_CXX+=	${TESTS_CXX}
     22 LDADD+=		-latf-c++ -latf-c
     23 .  for _T in ${TESTS_CXX}
     24 BINDIR.${_T}=	${TESTSDIR}
     25 MAN.${_T}?=	# empty
     26 _TESTS+=	${_T}
     27 .  endfor
     28 .endif
     29 
     30 .if defined(TESTS_SH)
     31 
     32 .  for _T in ${TESTS_SH}
     33 SCRIPTS+=		${_T}
     34 SCRIPTSDIR_${_T}=	${TESTSDIR}
     35 
     36 _TESTS+=		${_T}
     37 CLEANFILES+=		${_T} ${_T}.tmp
     38 
     39 TESTS_SH_SRC_${_T}?=	${_T}.sh
     40 ${_T}: ${TESTS_SH_SRC_${_T}} atf-compile-cookie
     41 	${_MKTARGET_BUILD}
     42 	${TOOL_ATF_COMPILE} -o ${.TARGET}.tmp ${.ALLSRC}
     43 	mv ${.TARGET}.tmp ${.TARGET}
     44 .  endfor
     45 .endif
     46 
     47 CLEANFILES+= atf-compile-cookie
     48 .if ${USETOOLS} == "yes"
     49 atf-compile-cookie: ${TOOL_ATF_COMPILE}
     50 	touch atf-compile-cookie
     51 .else
     52 atf-compile-cookie:
     53 	test -f atf-compile-cookie || touch atf-compile-cookie
     54 .endif
     55 
     56 .if !defined(NOATFFILE)
     57 FILES+=			Atffile
     58 FILESDIR_Atffile=	${TESTSDIR}
     59 .include <bsd.files.mk>
     60 .endif
     61 
     62 .if !empty(SCRIPTS) || !empty(PROGS) || !empty(PROGS_CXX)
     63 .  include <bsd.prog.mk>
     64 .endif
     65