Build shared version of BTF library
-- Daniel Rus Morales <danirus@tol-project.org> Tue, 17 Jul 2007 12:15:41 +0200
diff -u upstrm/BTF/Lib/Makefile debsrc/BTF/Lib/Makefile
--- upstrm/BTF/Lib/Makefile 2007-05-03 22:34:57.000000000 +0200
+++ debsrc/BTF/Lib/Makefile 2007-12-15 19:05:38.000000000 +0100
@@ -15,38 +15,57 @@
all: library
+SOVERSION = $(shell perl ../../debian/library-soname.pl BTF | sed 's/libbtf//')
+
-library: libbtf.a
+library: libbtf.a libbtf.so.$(SOVERSION)
OBJ = btf_order.o btf_maxtrans.o btf_strongcomp.o \
btf_l_order.o btf_l_maxtrans.o btf_l_strongcomp.o
+OBJ_SL = $(subst .o,.oo,$(OBJ))
libbtf.a: $(OBJ)
$(AR) libbtf.a $(OBJ)
$(RANLIB) libbtf.a
-$(OBJ): $(INC)
+libbtf.so.$(SOVERSION): $(OBJ_SL)
+ $(CC) -shared $^ -lm -Wl,-soname -Wl,$@ -o $@
+ ln -s $@ libbtf.so
+
+$(OBJ) $(OBJ_SL): $(INC)
#-------------------------------------------------------------------------------
btf_order.o: ../Source/btf_order.c
$(C) -c $(I) $< -o $@
+btf_order.oo: ../Source/btf_order.c
+ $(C) -fPIC -c $(I) $< -o $@
btf_maxtrans.o: ../Source/btf_maxtrans.c
$(C) -c $(I) $< -o $@
+btf_maxtrans.oo: ../Source/btf_maxtrans.c
+ $(C) -fPIC -c $(I) $< -o $@
btf_strongcomp.o: ../Source/btf_strongcomp.c
$(C) -c $(I) $< -o $@
+btf_strongcomp.oo: ../Source/btf_strongcomp.c
+ $(C) -fPIC -c $(I) $< -o $@
#-------------------------------------------------------------------------------
btf_l_order.o: ../Source/btf_order.c
$(C) -c $(I) -DDLONG $< -o $@
+btf_l_order.oo: ../Source/btf_order.c
+ $(C) -fPIC -c $(I) -DDLONG $< -o $@
btf_l_maxtrans.o: ../Source/btf_maxtrans.c
$(C) -c $(I) -DDLONG $< -o $@
+btf_l_maxtrans.oo: ../Source/btf_maxtrans.c
+ $(C) -fPIC -c $(I) -DDLONG $< -o $@
btf_l_strongcomp.o: ../Source/btf_strongcomp.c
$(C) -c $(I) -DDLONG $< -o $@
+btf_l_strongcomp.oo: ../Source/btf_strongcomp.c
+ $(C) -fPIC -c $(I) -DDLONG $< -o $@
#-------------------------------------------------------------------------------
@@ -57,3 +75,6 @@
clean:
- $(RM) $(CLEAN)
+ -$(RM) *.oo
+ -$(RM) *.a
+ -$(RM) *.so*