Replace SONAME with SOVERSION in makefile

- avoids duplication
- fixes warning about redefined rule with WINDOWS=1
This commit is contained in:
Manuel Pégourié-Gonnard 2015-02-13 13:15:13 +00:00
parent 5d46cca09a
commit 418080010a
2 changed files with 7 additions and 7 deletions

View File

@ -22,9 +22,9 @@ ifdef SHARED
CFLAGS += -fPIC CFLAGS += -fPIC
endif endif
SONAME=libmbedtls.so.7 SOVERSION=8
DLEXT=so.8 DLEXT=so.$(SOVERSION)
# OSX shared library extension: # OSX shared library extension:
# DLEXT=dylib # DLEXT=dylib
@ -89,14 +89,14 @@ libpolarssl.so: libmbedtls.so
echo " LN $@ -> $?" echo " LN $@ -> $?"
ln -sf $? $@ ln -sf $? $@
libmbedtls.${DLEXT}: $(OBJS)
echo " LD $@"
$(CC) ${LDFLAGS} -shared -Wl,-soname,$(SONAME) -o $@ $(OBJS)
libmbedtls.so: libmbedtls.${DLEXT} libmbedtls.so: libmbedtls.${DLEXT}
echo " LN $@ -> libmbedtls.${DLEXT}" echo " LN $@ -> libmbedtls.${DLEXT}"
ln -sf libmbedtls.${DLEXT} $@ ln -sf libmbedtls.${DLEXT} $@
libmbedtls.so.$(SOVERSION): $(OBJS)
echo " LD $@"
$(CC) ${LDFLAGS} -shared -Wl,-soname,$@ -o $@ $(OBJS)
libmbedtls.dylib: $(OBJS) libmbedtls.dylib: $(OBJS)
echo " LD $@" echo " LD $@"
$(CC) ${LDFLAGS} -dynamiclib -o $@ $(OBJS) $(CC) ${LDFLAGS} -dynamiclib -o $@ $(OBJS)

View File

@ -56,7 +56,7 @@ then
mv tmp library/CMakeLists.txt mv tmp library/CMakeLists.txt
[ $VERBOSE ] && echo "Bumping SOVERSION in library/Makefile" [ $VERBOSE ] && echo "Bumping SOVERSION in library/Makefile"
sed -e "s/SONAME=libpolarssl.so.[0-9]\+/SONAME=libpolarssl.so.$SOVERSION/g" -e "s/DLEXT=so.[0-9]\+/DLEXT=so.$SOVERSION/g" < library/Makefile > tmp sed -e "s/SOVERSION=[0-9]\+/SOVERSION=$SOVERSION/g" < library/Makefile > tmp
mv tmp library/Makefile mv tmp library/Makefile
fi fi