3 # (c) 2000, 2001, 2002 Fabrice Bellard
7 VPATH=$(SRC_PATH)/libavcodec
9 # NOTE: -I.. is needed to include config.h
10 CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I..
13 OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
14 mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
15 motion_est.o imgconvert.o imgresample.o msmpeg4.o \
16 mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
20 # currently using liba52 for ac3 decoding
21 ifeq ($(CONFIG_AC3),yes)
24 # using builtin liba52 or runtime linked liba52.so.0
25 ifneq ($(CONFIG_A52BIN),yes)
26 OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
27 liba52/imdct.o liba52/parse.o
31 ifeq ($(CONFIG_MP3LAME),yes)
32 OBJS += mp3lameaudio.o
33 EXTRALIBS += -lmp3lame
36 ifeq ($(TARGET_GPROF),yes)
41 # i386 mmx specific stuff
42 ifeq ($(TARGET_MMX),yes)
43 OBJS += i386/fdct_mmx.o i386/cputest.o \
44 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
45 i386/idct_mmx.o i386/motion_est_mmx.o \
46 i386/simple_idct_mmx.o
49 # armv4l specific stuff
50 ifeq ($(TARGET_ARCH_ARMV4L),yes)
51 ASM_OBJS += armv4l/jrevdct_arm.o
52 OBJS += armv4l/dsputil_arm.o
55 # sun mediaLib specific stuff
56 # currently only works when libavcodec is used in mplayer
57 ifeq ($(HAVE_MLIB),yes)
58 OBJS += mlib/dsputil_mlib.o
62 # alpha specific stuff
63 ifeq ($(TARGET_ARCH_ALPHA),yes)
64 OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
68 SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
69 OBJS := $(OBJS) $(ASM_OBJS)
72 ifeq ($(BUILD_SHARED),yes)
75 TESTS= imgresample-test dct-test motion-test
79 tests: apiexample cpuid_test $(TESTS)
86 $(CC) -shared -o $@ $(OBJS) $(EXTRALIBS)
88 dsputil.o: dsputil.c dsputil.h
91 $(CC) $(CFLAGS) -c -o $@ $<
94 $(CC) $(CFLAGS) -c -o $@ $<
96 # depend only used by mplayer now
100 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
103 rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
104 armv4l/*.o armv4l/*~ \
107 liba52/*.o liba52/*~ \
111 rm -f Makefile.bak .depend
113 # api example program
114 apiexample: apiexample.c $(LIB)
115 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
118 cpuid_test: i386/cputest.c
119 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
123 imgresample-test: imgresample.c
124 $(CC) $(CFLAGS) -DTEST -o $@ $^
126 dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
127 fdctref.o jrevdct.o i386/idct_mmx.o
130 motion-test: motion_test.o $(LIB)
134 # install -m 644 $(LIB) $(prefix)/lib
135 ifeq ($(BUILD_SHARED),yes)
136 install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
137 ln -sf $(prefix)/lib/libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
139 mkdir -p $(prefix)/include/ffmpeg
140 install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
141 install -m 644 common.h $(prefix)/include/ffmpeg/common.h
144 # include dependency files if they exist
146 ifneq ($(wildcard .depend),)