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@
|
|
|
|
# @CNAME@_BUILT
|
2006-07-25 19:00:04 +01:00
|
|
|
#
|
|
|
|
|
2006-08-09 11:16:18 +01:00
|
|
|
if [ -z ${@CNAME@_BUILT} ]
|
2006-07-25 19:00:04 +01:00
|
|
|
then
|
2006-08-09 11:16:18 +01:00
|
|
|
@CNAME@="obj/@NAME@"
|
2010-11-25 15:32:52 +00:00
|
|
|
EXTRAS="-std=gnu99 -D_GNU_SOURCE -DAPP_NAME=\"@NAME@\"" # TODO: more flags
|
2006-07-25 19:00:04 +01:00
|
|
|
|
2006-08-09 11:16:18 +01:00
|
|
|
echo "Building application ${@CNAME@}..."
|
2006-07-25 19:00:04 +01:00
|
|
|
|
|
|
|
do_cmd source src/@NAME@/build.monolithic || return 1
|
|
|
|
|
|
|
|
MODIFIED=0
|
|
|
|
for test in ${MONOLITHIC_TESTS} ${SRC}
|
|
|
|
do
|
2006-08-09 11:16:18 +01:00
|
|
|
if [ ${test} -nt ${@CNAME@} ]
|
2006-07-25 19:00:04 +01:00
|
|
|
then
|
|
|
|
MODIFIED=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ ${MODIFIED} -ne 0 ]
|
|
|
|
then
|
|
|
|
echo " Compiling..."
|
|
|
|
|
2006-08-10 17:02:05 +01:00
|
|
|
do_cmd ${CC} ${CFLAGS} -I obj -o "${@CNAME@}" ${SRC} ${EXTRAS} || return 1
|
2006-07-25 19:00:04 +01:00
|
|
|
|
|
|
|
print_success "Application built"
|
|
|
|
else
|
|
|
|
print_success "Application up to date"
|
|
|
|
fi
|
|
|
|
|
2006-08-09 11:16:18 +01:00
|
|
|
@CNAME@_BUILT=1
|
2006-07-25 19:00:04 +01:00
|
|
|
|
|
|
|
fi
|
|
|
|
|
2007-08-08 13:03:18 +01:00
|
|
|
# vim: syntax=sh:@VIM_MODELINE@
|