2006-07-25 19:00:04 +01:00
|
|
|
# These are external variables, and shouldn't clash with anything else
|
2006-08-09 11:16:18 +01:00
|
|
|
# @CNAME@_BUILT
|
2006-07-25 19:00:04 +01:00
|
|
|
#
|
|
|
|
|
2006-07-26 19:30:26 +01:00
|
|
|
build_target @TEST_LIBS@ || return 1
|
2006-07-25 19:00:04 +01:00
|
|
|
|
2006-07-26 19:30:26 +01:00
|
|
|
if [ -z ${@CNAME@_BUILT} ]
|
2006-07-25 19:00:04 +01:00
|
|
|
then
|
2006-07-26 19:30:26 +01:00
|
|
|
LIBS="@LINK_LIBS@"
|
2006-07-25 19:00:04 +01:00
|
|
|
EXTRAS="" # @TODO@ libs, cflags
|
|
|
|
|
|
|
|
echo "Building test programs..."
|
|
|
|
do_cmd mkdir -p obj/tests || return 1
|
|
|
|
|
2006-07-28 10:57:44 +01:00
|
|
|
for SRC in src/@NAME@/*.c
|
2006-07-25 19:00:04 +01:00
|
|
|
do
|
2008-05-09 16:53:18 +01:00
|
|
|
TEST="obj/tests/$(basename "${SRC}" ".c")"
|
2006-07-25 19:00:04 +01:00
|
|
|
MODIFIED=0
|
|
|
|
for file in ${LIBS} ${SRC} src/@NAME@/build.tests
|
|
|
|
do
|
|
|
|
if [ ${file} -nt ${TEST} ]
|
|
|
|
then
|
|
|
|
MODIFIED=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ ${MODIFIED} -ne 0 ]
|
|
|
|
then
|
|
|
|
do_cmd ${CC} -Iobj ${CFLAGS} -o ${TEST} ${SRC} ${LIBS} ${EXTRAS} || return 1
|
|
|
|
print_success "Built ${TEST}"
|
|
|
|
else
|
|
|
|
print_success "${TEST} is up to date"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
print_success "All tests built"
|
|
|
|
|
2006-07-26 19:30:26 +01:00
|
|
|
@CNAME@_BUILT=1
|
2006-07-25 19:00:04 +01:00
|
|
|
fi
|
|
|
|
|
2006-07-25 19:19:59 +01:00
|
|
|
# kate: @KATE_MODELINE@
|
2007-08-08 13:03:18 +01:00
|
|
|
# vim: syntax=sh:@VIM_MODELINE@
|