added wma decoder
[libav.git] / libavcodec / Makefile
CommitLineData
4cc281d9
FB
1#
2# libavcodec Makefile
ff4ec49e 3# (c) 2000, 2001, 2002 Fabrice Bellard
4cc281d9 4#
980fc7b8
FB
5include ../config.mak
6
4cc281d9
FB
7VPATH=$(SRC_PATH)/libavcodec
8
ff4ec49e 9# NOTE: -I.. is needed to include config.h
eddbd7e5 10CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
de6d9b64
FB
11LDFLAGS= -g
12
773cefc6 13OBJS= common.o utils.o mem.o allcodecs.o \
28db7fce 14 mpegvideo.o h263.o jrevdct.o jfdctfst.o jfdctint.o\
10b7b472 15 mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
de6d9b64 16 motion_est.o imgconvert.o imgresample.o msmpeg4.o \
be8ffec9 17 mpeg12.o h263dec.o svq1.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
4d2858de 18 ratecontrol.o adpcm.o eval.o dv.o error_resilience.o
980fc7b8 19ASM_OBJS=
de6d9b64 20
57514323 21# currently using liba52 for ac3 decoding
d771bcae 22ifeq ($(CONFIG_AC3),yes)
57514323 23OBJS+= a52dec.o
57514323
ZK
24
25# using builtin liba52 or runtime linked liba52.so.0
ff4ec49e 26ifneq ($(CONFIG_A52BIN),yes)
57514323
ZK
27OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
28 liba52/imdct.o liba52/parse.o
d771bcae 29endif
ff4ec49e 30endif
de6d9b64 31
5798368b
J
32ifeq ($(CONFIG_MP3LAME),yes)
33OBJS += mp3lameaudio.o
2a2a98c0 34EXTRALIBS += -lmp3lame
5798368b
J
35endif
36
81e0d0b4
MH
37ifeq ($(CONFIG_VORBIS),yes)
38OBJS += oggvorbis.o
39EXTRALIBS += -lvorbis -lvorbisenc
40endif
41
43f1708f
J
42ifeq ($(TARGET_GPROF),yes)
43CFLAGS+=-p
44LDFLAGS+=-p
45endif
46
de6d9b64 47# i386 mmx specific stuff
980fc7b8 48ifeq ($(TARGET_MMX),yes)
4300403e 49OBJS += i386/fdct_mmx.o i386/cputest.o \
de1ee36a 50 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
57514323 51 i386/idct_mmx.o i386/motion_est_mmx.o \
d962f6fd 52 i386/simple_idct_mmx.o
de6d9b64
FB
53endif
54
3d03c0a2
FB
55# armv4l specific stuff
56ifeq ($(TARGET_ARCH_ARMV4L),yes)
57ASM_OBJS += armv4l/jrevdct_arm.o
676e200c 58OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
3d03c0a2
FB
59endif
60
c34270f5
FB
61# sun mediaLib specific stuff
62# currently only works when libavcodec is used in mplayer
63ifeq ($(HAVE_MLIB),yes)
64OBJS += mlib/dsputil_mlib.o
65CFLAGS += $(MLIB_INC)
66endif
67
1e98dffb
NK
68# alpha specific stuff
69ifeq ($(TARGET_ARCH_ALPHA),yes)
8b313a47
FH
70OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
71 alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
f9bb4bdf 72ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
0af65aac 73CFLAGS += -fforce-addr -freduce-all-givs
1e98dffb
NK
74endif
75
59925ef2 76ifeq ($(TARGET_ARCH_POWERPC),yes)
ab6c65f6
BF
77OBJS += ppc/dsputil_ppc.o
78endif
79
d46aba26 80ifeq ($(TARGET_MMI),yes)
5917d17c 81OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
d46aba26
LS
82endif
83
ab6c65f6 84ifeq ($(TARGET_ALTIVEC),yes)
59925ef2
BF
85CFLAGS += -faltivec
86OBJS += ppc/dsputil_altivec.o
87endif
88
bb7d4939 89SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
ff4ec49e 90OBJS := $(OBJS) $(ASM_OBJS)
980fc7b8 91
de6d9b64 92LIB= libavcodec.a
0fd94442 93ifeq ($(BUILD_SHARED),yes)
ff4ec49e 94SLIB= libavcodec.so
0fd94442 95endif
4300403e 96TESTS= imgresample-test dct-test motion-test
de6d9b64 97
0fd94442 98all: $(LIB) $(SLIB)
ff4ec49e 99
c10e9f70 100tests: apiexample cpuid_test $(TESTS)
de6d9b64 101
ff4ec49e 102$(LIB): $(OBJS)
de6d9b64 103 rm -f $@
be7109c1
MN
104 $(AR) rc $@ $(OBJS)
105 $(RANLIB) $@
ff4ec49e
FB
106
107$(SLIB): $(OBJS)
e1707f52 108 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
de6d9b64
FB
109
110dsputil.o: dsputil.c dsputil.h
111
112%.o: %.c
113 $(CC) $(CFLAGS) -c -o $@ $<
114
3d03c0a2
FB
115%.o: %.S
116 $(CC) $(CFLAGS) -c -o $@ $<
117
0af65aac
FH
118# motion_est_alpha uses the MVI extension, which is not available with
119# -mcpu=ev4 (default) or ev5/ev56. Thus, force -mcpu=pca56 in those
120# cases.
121ifeq ($(TARGET_ARCH_ALPHA),yes)
122alpha/motion_est_alpha.o: alpha/motion_est_alpha.c
123 cpu=`echo "$(CFLAGS)" | sed -n 's,.*-mcpu=\([a-zA-Z0-9]*\).*,\1,p'`; \
124 case x"$$cpu" in x|xev[45]*) newcpu=pca56;; *) newcpu=$$cpu;; esac; \
125 echo $(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<;\
126 $(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<
127endif
128
980fc7b8
FB
129# depend only used by mplayer now
130dep: depend
131
132depend:
133 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
134
de6d9b64 135clean:
1ac9248b 136 rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
3d03c0a2 137 armv4l/*.o armv4l/*~ \
c34270f5 138 mlib/*.o mlib/*~ \
1e98dffb 139 alpha/*.o alpha/*~ \
59925ef2 140 ppc/*.o ppc/*~ \
d46aba26 141 ps2/*.o ps2/*~ \
57514323
ZK
142 liba52/*.o liba52/*~ \
143 apiexample $(TESTS)
de6d9b64 144
800d7ceb 145distclean: clean
980fc7b8
FB
146 rm -f Makefile.bak .depend
147
de6d9b64
FB
148# api example program
149apiexample: apiexample.c $(LIB)
cfda33cb 150 $(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
de6d9b64 151
c10e9f70
NK
152# cpuid test
153cpuid_test: i386/cputest.c
154 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
155
de6d9b64
FB
156# testing progs
157
158imgresample-test: imgresample.c
6acce86b 159 $(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
de6d9b64 160
86748dbc
MN
161dct-test: dct-test.o jfdctfst.o jfdctint.o i386/fdct_mmx.o\
162 fdctref.o jrevdct.o i386/idct_mmx.o simple_idct.o i386/simple_idct_mmx.o
90cee0c3 163 $(CC) -o $@ $^ -lm
d771bcae 164
4300403e 165motion-test: motion_test.o $(LIB)
6acce86b 166 $(CC) -o $@ $^ -lm
4300403e 167
0fd94442 168install: all
0fd94442 169ifeq ($(BUILD_SHARED),yes)
c1325d18 170 install -d $(prefix)/lib
ff4ec49e 171 install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
c1325d18
VM
172 ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
173 ldconfig || true
ff4ec49e 174 mkdir -p $(prefix)/include/ffmpeg
3565eeaa
FH
175 install -m 644 $(VPATH)/avcodec.h $(prefix)/include/ffmpeg/avcodec.h
176 install -m 644 $(VPATH)/common.h $(prefix)/include/ffmpeg/common.h
0fd94442 177endif
773cefc6
FB
178
179installlib: all
180 install -m 644 $(LIB) $(prefix)/lib
181 mkdir -p $(prefix)/include/ffmpeg
182 install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
183 $(prefix)/include/ffmpeg
184
d771bcae
FB
185#
186# include dependency files if they exist
187#
188ifneq ($(wildcard .depend),)
189include .depend
190endif