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

52 lines
1.2 KiB
Plaintext
Raw Normal View History

# 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 22:37:26 +01:00
if [ -z ${@CNAME@_BUILT} ]
then
2006-07-24 22:37:26 +01:00
@CNAME@_BASE=@NAME@
source src/@NAME@/soversion
2006-07-24 22:37:26 +01:00
@CNAME@="obj/${@CNAME@_BASE}.so.${SOMAJOR}.${SOMINOR}.${SOMICRO}"
SO_EXTRA="-lstdc++ -lc" # @TODO@ libs, cflags
2006-07-24 22:37:26 +01:00
echo "Building library ${@CNAME@}..."
source src/@NAME@/build.monolithic
MODIFIED=0
for test in ${MONOLITHIC_TESTS} ${HDR} ${SRC}
do
2006-07-24 22:37:26 +01:00
if [ ${test} -nt ${@CNAME@} ]
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@}" \
-Wl,-soname,${SONAME} \
${SRC} ${SO_EXTRA} || return 1
# make tests work
2006-07-24 22:37:26 +01:00
do_cmd ln -sf $(basename ${@CNAME@}) obj/${SONAME} || return 1
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}
fi
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
# vim: expandtab:ts=4:sw=4