comparison Makefile @ 136:669955525b67 libavcodec

Shared objects support
author nickols_k
date Sat, 27 Oct 2001 12:04:27 +0000
parents 1d3eb6cdc6b5
children 21532c56ed8b
comparison
equal deleted inserted replaced
135:5083d662ff85 136:669955525b67
37 endif 37 endif
38 38
39 SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s) 39 SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
40 40
41 LIB= libavcodec.a 41 LIB= libavcodec.a
42 ifeq ($(BUILD_SHARED),yes)
43 SLIB= libffmpeg-$(VERSION).so
44 endif
42 TESTS= imgresample-test dct-test motion-test 45 TESTS= imgresample-test dct-test motion-test
43 46
44 all: $(LIB) 47 all: $(LIB) $(SLIB)
45 tests: apiexample cpuid_test $(TESTS) 48 tests: apiexample cpuid_test $(TESTS)
46 49
47 $(LIB): $(OBJS) $(ASM_OBJS) 50 $(LIB): $(OBJS) $(ASM_OBJS)
48 rm -f $@ 51 rm -f $@
49 $(AR) rcs $@ $(OBJS) $(ASM_OBJS) 52 $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
50 53
54 $(SLIB): $(OBJS) $(ASM_OBJS)
55 rm -f $@
56 $(CC) -shared -o $@ $(OBJS) $(ASM_OBJS)
57 ln -sf $@ libffmpeg.so
51 dsputil.o: dsputil.c dsputil.h 58 dsputil.o: dsputil.c dsputil.h
52 59
53 %.o: %.c 60 %.o: %.c
54 $(CC) $(CFLAGS) -c -o $@ $< 61 $(CC) $(CFLAGS) -c -o $@ $<
55 62
61 68
62 depend: 69 depend:
63 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend 70 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
64 71
65 clean: 72 clean:
66 rm -f *.o *~ *.a i386/*.o i386/*~ \ 73 rm -f *.o *~ $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
67 armv4l/*.o armv4l/*~ \ 74 armv4l/*.o armv4l/*~ \
68 mlib/*.o mlib/*~ \ 75 mlib/*.o mlib/*~ \
69 libac3/*.o libac3/*~ \ 76 libac3/*.o libac3/*~ \
70 apiexample $(TESTS) 77 apiexample $(TESTS)
71 78
90 $(CC) -o $@ $^ 97 $(CC) -o $@ $^
91 98
92 motion-test: motion_test.o $(LIB) 99 motion-test: motion_test.o $(LIB)
93 $(CC) -o $@ $^ 100 $(CC) -o $@ $^
94 101
102 install: all
103 # install -s -m 644 $(LIB) $(prefix)/lib
104 ifeq ($(BUILD_SHARED),yes)
105 install -s -m 755 $(SLIB) $(prefix)/lib
106 ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
107 ldconfig
108 endif
95 # 109 #
96 # include dependency files if they exist 110 # include dependency files if they exist
97 # 111 #
98 ifneq ($(wildcard .depend),) 112 ifneq ($(wildcard .depend),)
99 include .depend 113 include .depend