2006-07-24 20:19:15 +01:00
|
|
|
# These are external variables, and shouldn't clash with anything else
|
2006-07-24 21:55:12 +01:00
|
|
|
# @NAME@_BUILT
|
2006-07-24 20:19:15 +01:00
|
|
|
#
|
|
|
|
|
2006-07-25 09:27:37 +01:00
|
|
|
#@TODO@ build_target libs || return 1
|
2006-07-24 20:19:15 +01:00
|
|
|
|
2006-07-24 21:55:12 +01:00
|
|
|
if [ -z ${@NAME@_BUILT} ]
|
2006-07-24 20:19:15 +01:00
|
|
|
then
|
2006-07-24 22:37:26 +01:00
|
|
|
LIBS="" # @TODO@ internal libs
|
2006-07-24 21:55:12 +01:00
|
|
|
EXTRAS="" # @TODO@ libs, cflags
|
|
|
|
|
2006-07-24 20:19:15 +01:00
|
|
|
echo "Building test programs..."
|
2006-07-24 22:37:26 +01:00
|
|
|
do_cmd mkdir -p obj/tests || return 1
|
2006-07-24 20:19:15 +01:00
|
|
|
|
2006-07-24 21:55:12 +01:00
|
|
|
for SRC in src/@NAME@/*.cpp
|
2006-07-24 20:19:15 +01:00
|
|
|
do
|
2006-07-24 22:37:26 +01:00
|
|
|
TEST="obj/tests/$(basename ${SRC} | sed -e 's,.cpp$,,')"
|
2006-07-24 20:19:15 +01:00
|
|
|
MODIFIED=0
|
2006-07-24 21:55:12 +01:00
|
|
|
for file in ${LIBS} ${SRC} src/@NAME@/build.tests
|
2006-07-24 20:19:15 +01:00
|
|
|
do
|
|
|
|
if [ ${file} -nt ${TEST} ]
|
|
|
|
then
|
|
|
|
MODIFIED=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ ${MODIFIED} -ne 0 ]
|
|
|
|
then
|
2006-07-24 21:55:12 +01:00
|
|
|
do_cmd ${CXX} -Iobj ${CFLAGS} -o ${TEST} ${SRC} ${LIBS} ${EXTRAS} || return 1
|
2006-07-24 20:19:15 +01:00
|
|
|
print_success "Built ${TEST}"
|
|
|
|
else
|
|
|
|
print_success "${TEST} is up to date"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
print_success "All tests built"
|
|
|
|
|
2006-07-24 21:55:12 +01:00
|
|
|
@NAME@_BUILT=1
|
2006-07-24 20:19:15 +01:00
|
|
|
fi
|
|
|
|
|
2006-07-24 21:55:12 +01:00
|
|
|
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
|
|
|
# vim: expandtab:ts=4:sw=4
|