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

39 lines
728 B
Plaintext
Raw Normal View History

# These are external variables, and shouldn't clash with anything else
# @NAME@
# @NAME@_BUILT
#
if [ -z ${@NAME@_BUILT} ]
then
@NAME@="obj/@NAME@"
EXTRAS="@TODO@" # cflags, libs
echo "Building application ${@NAME@}..."
source src/cppapp/build.monolithic
MODIFIED=0
for test in ${MONOLITHIC_TESTS} ${SRC}
do
if [ ${test} -nt ${@NAME@} ]
then
MODIFIED=1
break
fi
done
if [ ${MODIFIED} -ne 0 ]
then
echo " Compiling..."
do_cmd ${CXX} ${CFLAGS} -o "${@NAME@}" ${SRC} ${EXTRAS} || return 1
print_success "Application built"
else
print_success "Application up to date"
fi
@NAME@_BUILT=1
fi