lw-build-system/skel/scripts/build.c++.tests/build.tests

44 lines
1.0 KiB
Plaintext
Raw Normal View History

# These are external variables, and shouldn't clash with anything else
# @NAME@_BUILT
#
2006-07-25 09:27:37 +01:00
#@TODO@ build_target libs || return 1
if [ -z ${@NAME@_BUILT} ]
then
2006-07-24 22:37:26 +01:00
LIBS="" # @TODO@ internal libs
EXTRAS="" # @TODO@ libs, cflags
echo "Building test programs..."
2006-07-24 22:37:26 +01:00
do_cmd mkdir -p obj/tests || return 1
for SRC in src/@NAME@/*.cpp
do
2006-07-24 22:37:26 +01:00
TEST="obj/tests/$(basename ${SRC} | sed -e 's,.cpp$,,')"
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 ${CXX} -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"
@NAME@_BUILT=1
fi
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
# vim: expandtab:ts=4:sw=4