56 lines
1.3 KiB
Bash
56 lines
1.3 KiB
Bash
# These are external variables, and shouldn't clash with anything else
|
|
# @CNAME@
|
|
# @CNAME@_BUILT
|
|
# @CNAME@_HEADER
|
|
# @CNAME@_BASE
|
|
# @CNAME@_DEP_CFLAGS
|
|
# @CNAME@_DEP_LIBS
|
|
|
|
if [ -z ${@CNAME@_BUILT} ]
|
|
then
|
|
@CNAME@_BASE=@NAME@
|
|
source src/@NAME@/soversion
|
|
|
|
@CNAME@="obj/${@CNAME@_BASE}.so.${SOMAJOR}.${SOMINOR}.${SOMICRO}"
|
|
@CNAME@_DEP_CFLAGS="" # @TODO@ cflags
|
|
@CNAME@_DEP_LIBS="" # @TODO@ libs
|
|
SO_EXTRA="${@CNAME@_DEP_CFLAGS} ${@CNAME@_DEP_LIBS} -lstdc++ -lc"
|
|
|
|
echo "Building library ${@CNAME@}..."
|
|
|
|
do_cmd source src/@NAME@/build.monolithic || return 1
|
|
|
|
MODIFIED=0
|
|
for test in ${MONOLITHIC_TESTS} ${HDR} ${SRC}
|
|
do
|
|
if [ ${test} -nt ${@CNAME@} ]
|
|
then
|
|
MODIFIED=1
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [ ${MODIFIED} -ne 0 ]
|
|
then
|
|
echo " Compiling"
|
|
|
|
SONAME="${@CNAME@_BASE}.so.${SOMAJOR}.${SOMINOR}"
|
|
do_cmd ${CXX} ${CFLAGS} -Iobj -shared -fpic -o "${@CNAME@}" \
|
|
-Wl,-soname,${SONAME} \
|
|
${SRC} ${SO_EXTRA} || return 1
|
|
|
|
# make tests work
|
|
do_cmd ln -sf $(basename ${@CNAME@}) obj/${SONAME} || return 1
|
|
|
|
print_success "Library built"
|
|
else
|
|
print_success "Library up to date"
|
|
fi
|
|
|
|
@CNAME@_BUILT=1
|
|
@CNAME@_HEADER=${HDR}
|
|
|
|
fi
|
|
# kate: @KATE_MODELINE@
|
|
# vim: syntax=sh:@VIM_MODELINE@
|