3 CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I. -I..
6 OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
7 mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
8 motion_est.o imgconvert.o imgresample.o msmpeg4.o \
9 mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
13 # currently using liba52 for ac3 decoding
14 ifeq ($(CONFIG_AC3),yes)
18 # using builtin liba52 or runtime linked liba52.so.0
19 ifeq ($(CONFIG_A52BIN),no)
20 OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
21 liba52/imdct.o liba52/parse.o
24 ifeq ($(CONFIG_MP3LAME),yes)
25 OBJS += mp3lameaudio.o
26 EXTRALIBS += -lmp3lame
29 ifeq ($(TARGET_GPROF),yes)
34 # i386 mmx specific stuff
35 ifeq ($(TARGET_MMX),yes)
36 OBJS += i386/fdct_mmx.o i386/cputest.o \
37 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
38 i386/idct_mmx.o i386/motion_est_mmx.o \
39 i386/simple_idct_mmx.o
42 # armv4l specific stuff
43 ifeq ($(TARGET_ARCH_ARMV4L),yes)
44 ASM_OBJS += armv4l/jrevdct_arm.o
45 OBJS += armv4l/dsputil_arm.o
48 # sun mediaLib specific stuff
49 # currently only works when libavcodec is used in mplayer
50 ifeq ($(HAVE_MLIB),yes)
51 OBJS += mlib/dsputil_mlib.o
55 # alpha specific stuff
56 ifeq ($(TARGET_ARCH_ALPHA),yes)
57 OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
61 SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
64 ifeq ($(BUILD_SHARED),yes)
65 SLIB= libffmpeg-$(VERSION).so
67 TESTS= imgresample-test dct-test motion-test
70 tests: apiexample cpuid_test $(TESTS)
72 $(LIB): $(OBJS) $(ASM_OBJS)
74 $(AR) rc $@ $(OBJS) $(ASM_OBJS)
76 $(SLIB): $(OBJS) $(ASM_OBJS)
78 $(CC) -shared -o $@ $(OBJS) $(ASM_OBJS) $(EXTRALIBS)
79 ln -sf $@ libffmpeg.so
80 dsputil.o: dsputil.c dsputil.h
83 $(CC) $(CFLAGS) -c -o $@ $<
86 $(CC) $(CFLAGS) -c -o $@ $<
88 # depend only used by mplayer now
92 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
95 rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
96 armv4l/*.o armv4l/*~ \
99 liba52/*.o liba52/*~ \
103 rm -f Makefile.bak .depend
105 # api example program
106 apiexample: apiexample.c $(LIB)
107 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
110 cpuid_test: i386/cputest.c
111 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
115 imgresample-test: imgresample.c
116 $(CC) $(CFLAGS) -DTEST -o $@ $^
118 dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
119 fdctref.o jrevdct.o i386/idct_mmx.o
122 motion-test: motion_test.o $(LIB)
126 # install -m 644 $(LIB) $(prefix)/lib
127 ifeq ($(BUILD_SHARED),yes)
128 install -s -m 755 $(SLIB) $(prefix)/lib
129 ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
131 mkdir -p $(prefix)/include/libffmpeg
132 install -m 644 avcodec.h $(prefix)/include/libffmpeg/avcodec.h
133 install -m 644 common.h $(prefix)/include/libffmpeg/common.h
136 # include dependency files if they exist
138 ifneq ($(wildcard .depend),)