diff -Naur make/linux/Makefile.org make/linux/Makefile --- make/linux/Makefile.org 2005-02-06 19:12:08.000000000 +0100 +++ make/linux/Makefile 2005-02-10 10:16:59.317212360 +0100 @@ -56,6 +56,8 @@ # Names LIBRARY=libmatroska.a +LIBRARY_SO=libmatroska.so +LIBRARY_SO_VER=libmatroska.so.0 # source-files sources:=$(wildcard ${SRC_DIR}*$(EXTENSION)) @@ -66,27 +68,38 @@ # object files; replace .cxx extension with .o objects:=$(patsubst %$(EXTENSION),%.o,$(sources)) +objects_so:=$(patsubst %$(EXTENSION),%.lo,$(sources)) + WARNINGFLAGS=-Wall -Wno-unknown-pragmas -ansi -fno-gnu-keywords -D_GNU_SOURCE \ -Wshadow COMPILEFLAGS=$(DEBUGFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(WARNINGFLAGS) $(INCLUDE) LINKFLAGS=-L. -L$(LIBEBML_LIB_DIR) $(LDFLAGS) DEPENDFLAGS = $(CXXFLAGS) $(INCLUDE) -all: $(LIBRARY) +all: $(LIBRARY) $(LIBRARY_SO) -lib library: $(LIBRARY) +lib library: $(LIBRARY) $(LIBRARY_SO) # Build rules %.o: %$(EXTENSION) $(CXX) -c $(COMPILEFLAGS) -o $@ $< +%.lo: %$(EXTENSION) + $(CXX) -c $(COMPILEFLAGS) -fPIC -o $@ $< + $(LIBRARY): $(objects) $(AR) $@ $(objects) $(RANLIB) $@ +$(LIBRARY_SO): $(objects_so) + $(CXX) -shared -Wl,-soname,$(LIBRARY_SO_VER) -o $(LIBRARY_SO_VER) $(objects_so) -lebml + ln -s $(LIBRARY_SO_VER) $(LIBRARY_SO) + clean: cleantest rm -f $(objects) rm -f $(LIBRARY) + rm -f $(LIBRARY_SO) + rm -f $(LIBRARY_SO_VER) rm -f CORE cleantest: @@ -107,27 +120,29 @@ test: test6 test9 -test6: test6.o $(LIBRARY) +test6: test6.o $(LIBRARY) $(LIBRARY_SO) $(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS) test6.o: $(MUX_SRC_DIR)test6.cpp $(CXX) -c $(COMPILEFLAGS) -o $@ $< -test8: test8.o $(LIBRARY) +test8: test8.o $(LIBRARY) $(LIBRARY_SO) $(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS) test8.o: $(MUX_SRC_DIR)test8.cpp $(CXX) -c $(COMPILEFLAGS) -o $@ $< -test9: test9.o $(LIBRARY) +test9: test9.o $(LIBRARY) $(LIBRARY_SO) $(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS) test9.o: $(TAG_SRC_DIR)test9.cpp $(CXX) -c $(COMPILEFLAGS) -o $@ $< -install: $(LIBRARY) +install: $(LIBRARY) $(LIBRARY_SO) $(INSTALL) $(INSTALL_DIR_OPTS) -d $(libdir) $(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY) $(libdir) + $(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY_SO_VER) $(libdir) + ln -s $(LIBRARY_SO_VER) $(libdir)/$(LIBRARY_SO) $(INSTALL) $(INSTALL_DIR_OPTS) -d $(includedir) for i in $(INCLUDE_DIR)/*.h; do \ $(INSTALL) $(INSTALL_OPTS) $$i $(includedir) ; \