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