# HG changeset patch # User nickols_k # Date 1004184267 0 # Node ID 669955525b671b279196afe295a0c9e87d5ce159 # Parent 5083d662ff8568d7e7aa7713e306772c833754aa Shared objects support diff -r 5083d662ff85 -r 669955525b67 Makefile --- a/Makefile Fri Oct 26 09:34:41 2001 +0000 +++ b/Makefile Sat Oct 27 12:04:27 2001 +0000 @@ -39,15 +39,22 @@ SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s) LIB= libavcodec.a +ifeq ($(BUILD_SHARED),yes) +SLIB= libffmpeg-$(VERSION).so +endif TESTS= imgresample-test dct-test motion-test -all: $(LIB) +all: $(LIB) $(SLIB) tests: apiexample cpuid_test $(TESTS) $(LIB): $(OBJS) $(ASM_OBJS) rm -f $@ $(AR) rcs $@ $(OBJS) $(ASM_OBJS) +$(SLIB): $(OBJS) $(ASM_OBJS) + rm -f $@ + $(CC) -shared -o $@ $(OBJS) $(ASM_OBJS) + ln -sf $@ libffmpeg.so dsputil.o: dsputil.c dsputil.h %.o: %.c @@ -63,7 +70,7 @@ $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend clean: - rm -f *.o *~ *.a i386/*.o i386/*~ \ + rm -f *.o *~ $(LIB) $(SLIB) *.so i386/*.o i386/*~ \ armv4l/*.o armv4l/*~ \ mlib/*.o mlib/*~ \ libac3/*.o libac3/*~ \ @@ -92,6 +99,13 @@ motion-test: motion_test.o $(LIB) $(CC) -o $@ $^ +install: all +# install -s -m 644 $(LIB) $(prefix)/lib +ifeq ($(BUILD_SHARED),yes) + install -s -m 755 $(SLIB) $(prefix)/lib + ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so + ldconfig +endif # # include dependency files if they exist #