1274074Sngie# $FreeBSD: releng/10.2/share/mk/netbsd-tests.test.mk 276478 2014-12-31 20:13:31Z ngie $ 2274074Sngie 3274074Sngie.if !target(__netbsd_tests.test.mk__) 4274074Sngie__netbsd_tests.test.mk__: 5274074Sngie 6274074Sngie.if !defined(OBJTOP) 7274074Sngie.error "Please define OBJTOP to the absolute path of the top of the object tree" 8274074Sngie.endif 9274074Sngie 10274074Sngie.if !defined(SRCTOP) 11274074Sngie.error "Please define SRCTOP to the absolute path of the top of the source tree" 12274074Sngie.endif 13274074Sngie 14274074Sngie.if !defined(TESTSRC) 15274074Sngie.error "Please define TESTSRC to the absolute path of the test sources, e.g. contrib/netbsd-tests/lib/libc/stdio" 16274074Sngie.endif 17274074Sngie 18274074Sngie.PATH: ${TESTSRC} 19274074Sngie 20274074SngieLIBNETBSD_SRCDIR= ${SRCTOP}/lib/libnetbsd 21274074SngieLIBNETBSD_OBJDIR= ${OBJTOP}/lib/libnetbsd 22274074Sngie 23274074Sngie.for t in ${NETBSD_ATF_TESTS_C} 24274074SngieCFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests 25274074SngieLDFLAGS.$t+= -L${LIBNETBSD_OBJDIR} 26274074Sngie 27274074SngieDPADD.$t+= ${LIBNETBSD} 28274074SngieLDADD.$t+= -lnetbsd 29274074Sngie 30274074SngieSRCS.$t?= ${t:C/^/t_/:C/_test$//g}.c 31274074Sngie.endfor 32274074Sngie 33274074SngieATF_TESTS_C+= ${NETBSD_ATF_TESTS_C} 34274074Sngie 35274074Sngie# A C++ analog isn't provided because there aren't any C++ testcases in 36274074Sngie# contrib/netbsd-tests 37274074Sngie 38274074Sngie.for t in ${NETBSD_ATF_TESTS_SH} 39274074SngieATF_TESTS_SH_SRC_$t?= ${t:C/^/t_/:C/_test$//g}.sh 40274074Sngie.endfor 41274074Sngie 42274074SngieATF_TESTS_SH+= ${NETBSD_ATF_TESTS_SH} 43274074Sngie 44274074Sngie.endif 45274074Sngie 46274074Sngie# vim: syntax=make 47