allows user-settable block size and fixes related typo
[libav.git] / libavcodec / Makefile
CommitLineData
4cc281d9
FB
1#
2# libavcodec Makefile
6d6d7970 3# (c) 2000-2005 Fabrice Bellard
4cc281d9 4#
980fc7b8
FB
5include ../config.mak
6
ff4ec49e 7# NOTE: -I.. is needed to include config.h
f130fd46
DB
8CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavutil \
9 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE $(AMR_CFLAGS)
de6d9b64 10
caa336b4 11OBJS= bitstream.o utils.o mem.o allcodecs.o \
1d0d55da 12 mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
0ac3dcb8 13 mjpeg.o resample.o resample2.o dsputil.o \
1d0d55da 14 motion_est.o imgconvert.o imgresample.o \
4f1bb8a9 15 mpeg12.o mpegaudiodec.o pcm.o simple_idct.o \
8b975b7c
MN
16 ratecontrol.o adpcm.o eval.o error_resilience.o \
17 fft.o mdct.o raw.o golomb.o cabac.o\
c11c2bc2 18 dpcm.o adx.o faandct.o parser.o g726.o \
689abe56 19 vp3dsp.o h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o \
748c2fca
MN
20 opt.o \
21 bitstream_filter.o \
22
240c1657 23
d59518d4 24HEADERS = avcodec.h
8b2121e3 25
bac3be38
MR
26OBJS-$(CONFIG_AASC_DECODER) += aasc.o
27OBJS-$(CONFIG_AC3_ENCODER) += ac3enc.o
28OBJS-$(CONFIG_ALAC_DECODER) += alac.o
29OBJS-$(CONFIG_ASV1_DECODER) += asv1.o
30OBJS-$(CONFIG_ASV1_ENCODER) += asv1.o
31OBJS-$(CONFIG_ASV2_DECODER) += asv1.o
32OBJS-$(CONFIG_ASV2_ENCODER) += asv1.o
33OBJS-$(CONFIG_AVS_DECODER) += avs.o
34OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdsp.o
35OBJS-$(CONFIG_CINEPAK_DECODER) += cinepak.o
36OBJS-$(CONFIG_COOK_DECODER) += cook.o
37OBJS-$(CONFIG_CLJR_DECODER) += cljr.o
38OBJS-$(CONFIG_CLJR_ENCODER) += cljr.o
39OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o
40OBJS-$(CONFIG_DVBSUB_DECODER) += dvbsubdec.o
41OBJS-$(CONFIG_DVBSUB_ENCODER) += dvbsub.o
42OBJS-$(CONFIG_DVDSUB_DECODER) += dvdsub.o
43OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
44OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o
45OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o
46OBJS-$(CONFIG_EIGHTBPS_DECODER) += 8bps.o
47OBJS-$(CONFIG_FFV1_DECODER) += ffv1.o
48OBJS-$(CONFIG_FFV1_ENCODER) += ffv1.o
49OBJS-$(CONFIG_FLAC_DECODER) += flac.o
50OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o
51OBJS-$(CONFIG_FLIC_DECODER) += flicvideo.o
52OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
53OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o
54OBJS-$(CONFIG_H261_DECODER) += h261.o
55OBJS-$(CONFIG_H261_ENCODER) += h261.o
56OBJS-$(CONFIG_H264_DECODER) += h264.o
57OBJS-$(CONFIG_SVQ3_DECODER) += h264.o
58OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o
59OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o
60OBJS-$(CONFIG_FFVHUFF_DECODER) += huffyuv.o
61OBJS-$(CONFIG_FFVHUFF_ENCODER) += huffyuv.o
62OBJS-$(CONFIG_IDCIN_DECODER) += idcinvideo.o
63OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o
64OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o
65OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
66OBJS-$(CONFIG_KMVC_DECODER) += kmvc.o
67OBJS-$(CONFIG_MSZH_DECODER) += lcl.o
68OBJS-$(CONFIG_ZLIB_DECODER) += lcl.o
69OBJS-$(CONFIG_ZLIB_ENCODER) += lcl.o
70OBJS-$(CONFIG_LOCO_DECODER) += loco.o
71OBJS-$(CONFIG_MACE3_DECODER) += mace.o
72OBJS-$(CONFIG_MACE6_DECODER) += mace.o
73OBJS-$(CONFIG_MP2_ENCODER) += mpegaudio.o
74OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o
75OBJS-$(CONFIG_MSVIDEO1_DECODER) += msvideo1.o
76OBJS-$(CONFIG_PNG_DECODER) += png.o
77OBJS-$(CONFIG_PNG_ENCODER) += png.o
78OBJS-$(CONFIG_QDM2_DECODER) += qdm2.o
79OBJS-$(CONFIG_QDRAW_DECODER) += qdrw.o
80OBJS-$(CONFIG_QPEG_DECODER) += qpeg.o
81OBJS-$(CONFIG_QTRLE_DECODER) += qtrle.o
82OBJS-$(CONFIG_RA_144_DECODER) += ra144.o
83OBJS-$(CONFIG_RA_288_DECODER) += ra288.o
84OBJS-$(CONFIG_ROQ_DECODER) += roqvideo.o
85OBJS-$(CONFIG_RPZA_DECODER) += rpza.o
86OBJS-$(CONFIG_RV10_DECODER) += rv10.o
87OBJS-$(CONFIG_RV10_ENCODER) += rv10.o
88OBJS-$(CONFIG_RV20_DECODER) += rv10.o
89OBJS-$(CONFIG_RV20_ENCODER) += rv10.o
90OBJS-$(CONFIG_SHORTEN_DECODER) += shorten.o
91OBJS-$(CONFIG_SMACKER_DECODER) += smacker.o
92OBJS-$(CONFIG_SMACKAUD_DECODER) += smacker.o
93OBJS-$(CONFIG_SMC_DECODER) += smc.o
94OBJS-$(CONFIG_SNOW_DECODER) += snow.o
95OBJS-$(CONFIG_SNOW_ENCODER) += snow.o
96OBJS-$(CONFIG_SONIC_DECODER) += sonic.o
97OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o
98OBJS-$(CONFIG_SONIC_LS_DECODER) += sonic.o
99OBJS-$(CONFIG_SVQ1_DECODER) += svq1.o
100OBJS-$(CONFIG_SVQ1_ENCODER) += svq1.o
101OBJS-$(CONFIG_TRUEMOTION1_DECODER) += truemotion1.o
102OBJS-$(CONFIG_TRUEMOTION2_DECODER) += truemotion2.o
103OBJS-$(CONFIG_TRUESPEECH_DECODER) += truespeech.o
104OBJS-$(CONFIG_TTA_DECODER) += tta.o
105OBJS-$(CONFIG_TSCC_DECODER) += tscc.o
106OBJS-$(CONFIG_CSCD_DECODER) += cscd.o lzo.o
107OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o lzo.o
108OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
109OBJS-$(CONFIG_VC1_DECODER) += vc1.o
110OBJS-$(CONFIG_WMV3_DECODER) += vc1.o
111OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
112OBJS-$(CONFIG_VCR1_ENCODER) += vcr1.o
113OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdav.o
114OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdav.o
115OBJS-$(CONFIG_VORBIS_DECODER) += vorbis.o
116OBJS-$(CONFIG_VP3_DECODER) += vp3.o
117OBJS-$(CONFIG_THEORA_DECODER) += vp3.o
118OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
119OBJS-$(CONFIG_WMAV1_DECODER) += wmadec.o
120OBJS-$(CONFIG_WMAV2_DECODER) += wmadec.o
121OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o
122OBJS-$(CONFIG_WS_SND1_DECODER) += ws-snd1.o
123OBJS-$(CONFIG_XAN_WC3_DECODER) += xan.o
124OBJS-$(CONFIG_XAN_WC4_DECODER) += xan.o
125OBJS-$(CONFIG_XL_DECODER) += xl.o
126OBJS-$(CONFIG_BMP_DECODER) += bmp.o
127OBJS-$(CONFIG_MMVIDEO_DECODER) += mmvideo.o
128OBJS-$(CONFIG_ZMBV_DECODER) += zmbv.o
129OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
130
131OBJS-$(CONFIG_FAAD) += faad.o
132OBJS-$(CONFIG_FAAC) += faac.o
133OBJS-$(CONFIG_XVID) += xvidff.o xvid_rc.o
134OBJS-$(CONFIG_X264) += x264.o
135OBJS-$(CONFIG_MP3LAME) += mp3lameaudio.o
136OBJS-$(CONFIG_LIBVORBIS) += oggvorbis.o
137OBJS-$(CONFIG_LIBTHEORA) += oggtheora.o
138OBJS-$(CONFIG_LIBGSM) += libgsm.o
4f1bb8a9 139
57514323 140# currently using liba52 for ac3 decoding
bac3be38 141OBJS-$(CONFIG_AC3) += a52dec.o
57514323
ZK
142
143# using builtin liba52 or runtime linked liba52.so.0
bac3be38
MR
144OBJS-$(CONFIG_AC3)$(CONFIG_A52BIN) += liba52/bit_allocate.o \
145 liba52/bitstream.o \
146 liba52/downmix.o \
147 liba52/imdct.o \
148 liba52/parse.o \
149 liba52/crc.o \
150 liba52/resample.o
c11c2bc2 151
23c99253 152# currently using libdts for dts decoding
bac3be38
MR
153OBJS-$(CONFIG_DTS) += dtsdec.o
154CFLAGS-$(CONFIG_DTS) += $(DTS_INC)
23c99253 155
bac3be38
MR
156OBJS-$(AMR) += amr.o
157OBJS-$(AMR_NB) += amr_float/sp_dec.o \
158 amr_float/sp_enc.o \
159 amr_float/interf_dec.o \
160 amr_float/interf_enc.o
280bd7b7 161
bac3be38
MR
162ifeq ($(AMR_NB_FIXED),yes)
163EXTRAOBJS += amr/*.o
164EXTRADEPS=amrlibs
5c5dea3f 165endif
81e0d0b4 166
bac3be38
MR
167OBJS-$(AMR_WB) += amrwb_float/dec_acelp.o \
168 amrwb_float/dec_dtx.o \
169 amrwb_float/dec_gain.o \
170 amrwb_float/dec_if.o \
171 amrwb_float/dec_lpc.o \
172 amrwb_float/dec_main.o \
173 amrwb_float/dec_rom.o \
174 amrwb_float/dec_util.o \
175 amrwb_float/enc_acelp.o \
176 amrwb_float/enc_dtx.o \
177 amrwb_float/enc_gain.o \
178 amrwb_float/enc_if.o \
179 amrwb_float/enc_lpc.o \
180 amrwb_float/enc_main.o \
181 amrwb_float/enc_rom.o \
182 amrwb_float/enc_util.o \
183 amrwb_float/if_rom.o
184
185OBJS-$(HAVE_PTHREADS) += pthread.o
186OBJS-$(HAVE_W32THREADS) += w32thread.o
187OBJS-$(HAVE_OS2THREADS) += os2thread.o
188OBJS-$(HAVE_BEOSTHREADS) += beosthread.o
189
190OBJS-$(HAVE_XVMC_ACCEL) += xvmcvideo.o
bb4c2140 191
de6d9b64 192# i386 mmx specific stuff
980fc7b8 193ifeq ($(TARGET_MMX),yes)
4300403e 194OBJS += i386/fdct_mmx.o i386/cputest.o \
de1ee36a 195 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
57514323 196 i386/idct_mmx.o i386/motion_est_mmx.o \
38acbc3c 197 i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \
4567b4bd 198 i386/vp3dsp_sse2.o i386/fft_3dn.o i386/fft_3dn2.o i386/snowdsp_mmx.o
84740d59
MN
199ifeq ($(CONFIG_GPL),yes)
200OBJS += i386/idct_mmx_xvid.o
201endif
87318d69 202ifeq ($(TARGET_BUILTIN_VECTOR),yes)
a968e365 203i386/fft_sse.o: CFLAGS+= -msse
148beec7 204depend: CFLAGS+= -msse
a968e365 205endif
87318d69 206ifeq ($(TARGET_BUILTIN_3DNOW),yes)
82eb4b0f 207i386/fft_3dn.o: CFLAGS+= -m3dnow
c2f69579
GP
208ifeq ($(TARGET_ARCH_X86),yes)
209i386/fft_3dn2.o: CFLAGS+= -march=athlon
210endif
211ifeq ($(TARGET_ARCH_X86_64),yes)
212i386/fft_3dn2.o: CFLAGS+= -march=k8
213endif
82eb4b0f 214endif
de6d9b64
FB
215endif
216
3d03c0a2 217# armv4l specific stuff
bac3be38
MR
218ASM_OBJS-$(TARGET_ARCH_ARMV4L) += armv4l/jrevdct_arm.o \
219 armv4l/simple_idct_arm.o \
220 armv4l/dsputil_arm_s.o
221OBJS-$(TARGET_ARCH_ARMV4L) += armv4l/dsputil_arm.o \
222 armv4l/mpegvideo_arm.o
223OBJS-$(TARGET_IWMMXT) += armv4l/dsputil_iwmmxt.o \
224 armv4l/mpegvideo_iwmmxt.o
225
226# sun sparc
227OBJS-$(TARGET_ARCH_SPARC) += sparc/dsputil_vis.o
228sparc/dsputil_vis.o: CFLAGS += -mcpu=ultrasparc -mtune=ultrasparc
3d03c0a2 229
c34270f5 230# sun mediaLib specific stuff
bac3be38
MR
231OBJS-$(HAVE_MLIB) += mlib/dsputil_mlib.o
232CFLAGS-$(HAVE_MLIB) += $(MLIB_INC)
6ad1fa5a 233
1e98dffb 234# alpha specific stuff
bac3be38
MR
235OBJS-$(TARGET_ARCH_ALPHA) += alpha/dsputil_alpha.o \
236 alpha/mpegvideo_alpha.o \
237 alpha/simple_idct_alpha.o \
238 alpha/motion_est_alpha.o
239ASM_OBJS-$(TARGET_ARCH_ALPHA) += alpha/dsputil_alpha_asm.o \
240 alpha/motion_est_mvi_asm.o
241
242OBJS-$(TARGET_ARCH_POWERPC) += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
243OBJS-$(TARGET_MMI) += ps2/dsputil_mmi.o \
244 ps2/idct_mmi.o \
245 ps2/mpegvideo_mmi.o
246OBJS-$(TARGET_ARCH_SH4) += sh4/idct_sh4.o \
247 sh4/dsputil_sh4.o \
248 sh4/dsputil_align.o
249OBJS-$(TARGET_ALTIVEC) += ppc/dsputil_altivec.o \
250 ppc/mpegvideo_altivec.o \
251 ppc/idct_altivec.o \
252 ppc/fft_altivec.o \
253 ppc/gmc_altivec.o \
254 ppc/fdct_altivec.o \
255 ppc/dsputil_h264_altivec.o \
256 ppc/dsputil_snow_altivec.o
257
258CFLAGS += $(CFLAGS-yes)
259OBJS += $(OBJS-yes)
260ASM_OBJS += $(ASM_OBJS-yes)
ab6c65f6 261
bac3be38 262EXTRALIBS := -L../libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)
980fc7b8 263
4bdd05e7 264NAME=avcodec
c11c2bc2 265LIBAVUTIL= $(SRC_PATH)/libavutil/$(LIBPREF)avutil$(LIBSUF)
0fd94442 266ifeq ($(BUILD_SHARED),yes)
f3b60109
DB
267LIBVERSION=$(LAVCVERSION)
268LIBMAJOR=$(LAVCMAJOR)
0fd94442 269endif
6d2abd6b 270TESTS= imgresample-test dct-test motion-test fft-test
de6d9b64 271
8b2121e3
MR
272include $(SRC_PATH)/common.mak
273
bc634f6f
ZK
274amrlibs:
275 $(MAKE) -C amr spclib fipoplib
276
c10e9f70 277tests: apiexample cpuid_test $(TESTS)
de6d9b64 278
de6d9b64
FB
279dsputil.o: dsputil.c dsputil.h
280
c7f1a2f5 281clean::
8b2121e3 282 rm -f \
98013cc1 283 i386/*.o i386/*~ \
3d03c0a2 284 armv4l/*.o armv4l/*~ \
c34270f5 285 mlib/*.o mlib/*~ \
1e98dffb 286 alpha/*.o alpha/*~ \
59925ef2 287 ppc/*.o ppc/*~ \
d46aba26 288 ps2/*.o ps2/*~ \
0c6bd2ea 289 sh4/*.o sh4/*~ \
bb476ff3 290 sparc/*.o sparc/*~ \
57514323 291 liba52/*.o liba52/*~ \
c7f1a2f5 292 amr_float/*.o \
57514323 293 apiexample $(TESTS)
215e46e6
DB
294 -$(MAKE) -C amr clean
295 -$(MAKE) -C amrwb_float -f makefile.gcc clean
d663a1fd 296
de6d9b64
FB
297# api example program
298apiexample: apiexample.c $(LIB)
dc9cc5ed 299 $(CC) $(CFLAGS) -o $@ $< $(LIB) $(LIBAVUTIL) $(EXTRALIBS)
de6d9b64 300
c10e9f70
NK
301# cpuid test
302cpuid_test: i386/cputest.c
303 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
304
de6d9b64
FB
305# testing progs
306
307imgresample-test: imgresample.c
6acce86b 308 $(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
de6d9b64 309
9ebc63a9 310dct-test: dct-test.o fdctref.o $(LIB)
434df899 311 $(CC) -o $@ $^ -lm $(LIBAVUTIL)
d771bcae 312
4300403e 313motion-test: motion_test.o $(LIB)
6acce86b 314 $(CC) -o $@ $^ -lm
4300403e 315
923ceff8 316fft-test: fft-test.o $(LIB)
c11c2bc2 317 $(CC) -o $@ $^ $(LIBAVUTIL) -lm