2006-07-24 20:19:15 +01:00
|
|
|
# These are external variables, and shouldn't clash with anything else
|
2006-07-24 22:37:26 +01:00
|
|
|
# @CNAME@
|
|
|
|
# @CNAME@_BUILT
|
|
|
|
# @CNAME@_HEADER
|
|
|
|
# @CNAME@_BASE
|
2006-07-24 20:19:15 +01:00
|
|
|
|
2006-07-24 22:37:26 +01:00
|
|
|
if [ -z ${@CNAME@_BUILT} ]
|
2006-07-24 20:19:15 +01:00
|
|
|
then
|
2006-07-24 22:37:26 +01:00
|
|
|
@CNAME@_BASE=@NAME@
|
2006-07-24 21:55:12 +01:00
|
|
|
source src/@NAME@/soversion
|
2006-07-24 20:19:15 +01:00
|
|
|
|
2006-07-24 22:37:26 +01:00
|
|
|
@CNAME@="obj/${@CNAME@_BASE}.so.${SOMAJOR}.${SOMINOR}.${SOMICRO}"
|
2006-07-24 21:55:12 +01:00
|
|
|
SO_EXTRA="-lstdc++ -lc" # @TODO@ libs, cflags
|
2006-07-24 20:19:15 +01:00
|
|
|
|
2006-07-24 22:37:26 +01:00
|
|
|
echo "Building library ${@CNAME@}..."
|
2006-07-24 20:19:15 +01:00
|
|
|
|
2006-07-25 09:54:09 +01:00
|
|
|
do_cmd source src/@NAME@/build.monolithic || return 1
|
2006-07-24 20:19:15 +01:00
|
|
|
|
|
|
|
MODIFIED=0
|
|
|
|
for test in ${MONOLITHIC_TESTS} ${HDR} ${SRC}
|
|
|
|
do
|
2006-07-24 22:37:26 +01:00
|
|
|
if [ ${test} -nt ${@CNAME@} ]
|
2006-07-24 20:19:15 +01:00
|
|
|
then
|
|
|
|
MODIFIED=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ ${MODIFIED} -ne 0 ]
|
|
|
|
then
|
|
|
|
echo " Compiling"
|
|
|
|
|
2006-07-24 22:37:26 +01:00
|
|
|
SONAME="${@CNAME@_BASE}.so.${SOMAJOR}.${SOMINOR}"
|
|
|
|
do_cmd ${CXX} ${CFLAGS} -shared -fpic -o "${@CNAME@}" \
|
2006-07-24 20:19:15 +01:00
|
|
|
-Wl,-soname,${SONAME} \
|
2006-07-24 21:55:12 +01:00
|
|
|
${SRC} ${SO_EXTRA} || return 1
|
2006-07-24 20:19:15 +01:00
|
|
|
|
|
|
|
# make tests work
|
2006-07-24 22:37:26 +01:00
|
|
|
do_cmd ln -sf $(basename ${@CNAME@}) obj/${SONAME} || return 1
|
2006-07-24 20:19:15 +01:00
|
|
|
|
|
|
|
print_success "Library built"
|
|
|
|
else
|
|
|
|
print_success "Library up to date"
|
|
|
|
fi
|
|
|
|
|
2006-07-24 22:37:26 +01:00
|
|
|
@CNAME@_BUILT=1
|
|
|
|
@CNAME@_HEADER=${HDR}
|
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
|