liblwevent/src/tests/build.tests

44 lines
1.1 KiB
Bash

# These are external variables, and shouldn't clash with anything else
# tests_BUILT
#
build_target liblwevent || return 1
if [ -z ${tests_BUILT} ]
then
LIBS="${liblwevent} ${liblwevent_DEP_CFLAGS} ${liblwevent_DEP_LIBS} "
EXTRAS="-D_GNU_SOURCE -std=c99"
echo "Building test programs..."
do_cmd mkdir -p obj/tests || return 1
for SRC in src/tests/*.c
do
TEST="obj/tests/$(basename ${SRC} | sed -e 's,.c$,,')"
MODIFIED=0
for file in ${LIBS} ${SRC} src/tests/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"
tests_BUILT=1
fi
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
# vim: syntax=sh:expandtab:ts=4:sw=4