Misplaced CLEANAMR.
[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
c11c2bc2 8CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavutil -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE $(AMR_CFLAGS)
de6d9b64 9
caa336b4 10OBJS= bitstream.o utils.o mem.o allcodecs.o \
1d0d55da 11 mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
7b1fa7db 12 mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o \
1d0d55da 13 motion_est.o imgconvert.o imgresample.o \
4f1bb8a9 14 mpeg12.o mpegaudiodec.o pcm.o simple_idct.o \
8b975b7c
MN
15 ratecontrol.o adpcm.o eval.o error_resilience.o \
16 fft.o mdct.o raw.o golomb.o cabac.o\
c11c2bc2 17 dpcm.o adx.o faandct.o parser.o g726.o \
689abe56 18 vp3dsp.o h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o \
348e52c9 19 opt.o
240c1657 20
d59518d4 21HEADERS = avcodec.h
8b2121e3 22
8b975b7c
MN
23ifeq ($(CONFIG_AASC_DECODER),yes)
24 OBJS+= aasc.o
25endif
26ifeq ($(CONFIG_ALAC_DECODER),yes)
27 OBJS+= alac.o
28endif
29ifneq ($(CONFIG_ASV1_DECODER)$(CONFIG_ASV1_ENCODER)$(CONFIG_ASV2_DECODER)$(CONFIG_ASV2_ENCODER),)
30 OBJS+= asv1.o
31endif
26376701
MM
32ifeq ($(CONFIG_AVS_DECODER),yes)
33 OBJS+= avs.o
34endif
8b975b7c
MN
35ifeq ($(CONFIG_CINEPAK_DECODER),yes)
36 OBJS+= cinepak.o
37endif
e0f7e329
BL
38ifeq ($(CONFIG_COOK_DECODER),yes)
39 OBJS+= cook.o
40endif
8b975b7c
MN
41ifneq ($(CONFIG_CLJR_DECODER)$(CONFIG_CLJR_ENCODER),)
42 OBJS+= cljr.o
43endif
44ifeq ($(CONFIG_CYUV_DECODER),yes)
45 OBJS+= cyuv.o
46endif
348e52c9
GP
47ifeq ($(CONFIG_DVBSUB_DECODER),yes)
48 OBJS+= dvbsubdec.o
49endif
50ifeq ($(CONFIG_DVBSUB_ENCODER),yes)
51 OBJS+= dvbsub.o
52endif
53ifeq ($(CONFIG_DVDSUB_DECODER),yes)
54 OBJS+= dvdsub.o
55endif
56ifeq ($(CONFIG_DVDSUB_ENCODER),yes)
57 OBJS+= dvdsubenc.o
58endif
8b975b7c
MN
59ifneq ($(CONFIG_DVVIDEO_DECODER)$(CONFIG_DVVIDEO_ENCODER),)
60 OBJS+= dv.o
61endif
62ifeq ($(CONFIG_EIGHTBPS_DECODER),yes)
63 OBJS+= 8bps.o
64endif
65ifneq ($(CONFIG_FFV1_DECODER)$(CONFIG_FFV1_ENCODER),)
66 OBJS+= ffv1.o
67endif
68ifeq ($(CONFIG_FLAC_DECODER),yes)
69 OBJS+= flac.o
70endif
71ifeq ($(CONFIG_FLIC_DECODER),yes)
72 OBJS+= flicvideo.o
73endif
74ifeq ($(CONFIG_FOURXM_DECODER),yes)
75 OBJS+= 4xm.o
76endif
b81f8949
MM
77ifeq ($(CONFIG_FRAPS_DECODER),yes)
78 OBJS+= fraps.o
79endif
8b975b7c
MN
80ifneq ($(CONFIG_H261_DECODER)$(CONFIG_H261_ENCODER),)
81 OBJS+= h261.o
82endif
83ifneq ($(CONFIG_H264_DECODER)$(CONFIG_SVQ3_DECODER),)
84 OBJS+= h264.o
85endif
86ifneq ($(CONFIG_HUFFYUV_DECODER)$(CONFIG_HUFFYUV_ENCODER)$(CONFIG_FFVHUFF_DECODER)$(CONFIG_FFVHUFF_ENCODER),)
87 OBJS+= huffyuv.o
88endif
89ifeq ($(CONFIG_IDCIN_DECODER),yes)
90 OBJS+= idcinvideo.o
91endif
92ifeq ($(CONFIG_INDEO2_DECODER),yes)
93 OBJS+= indeo2.o
94endif
95ifeq ($(CONFIG_INDEO3_DECODER),yes)
96 OBJS+= indeo3.o
97endif
98ifeq ($(CONFIG_INTERPLAY_VIDEO_DECODER),yes)
99 OBJS+= interplayvideo.o
100endif
fd7b1991
KS
101ifeq ($(CONFIG_KMVC_DECODER),yes)
102 OBJS+= kmvc.o
103endif
8b975b7c
MN
104ifneq ($(CONFIG_MSZH_DECODER)$(CONFIG_ZLIB_DECODER)$(CONFIG_ZLIB_ENCODER),)
105 OBJS+= lcl.o
106endif
107ifeq ($(CONFIG_LOCO_DECODER),yes)
108 OBJS+= loco.o
109endif
110ifneq ($(CONFIG_MACE3_DECODER)$(CONFIG_MACE6_DECODER),)
111 OBJS+= mace.o
112endif
113ifeq ($(CONFIG_MSRLE_DECODER),yes)
114 OBJS+= msrle.o
115endif
116ifeq ($(CONFIG_MSVIDEO1_DECODER),yes)
117 OBJS+= msvideo1.o
118endif
119ifneq ($(CONFIG_PNG_DECODER)$(CONFIG_PNG_ENCODER),)
120 OBJS+= png.o
121endif
c555392a
RT
122ifeq ($(CONFIG_QDM2_DECODER),yes)
123 OBJS+= qdm2.o
124endif
8b975b7c
MN
125ifeq ($(CONFIG_QDRAW_DECODER),yes)
126 OBJS+= qdrw.o
127endif
128ifeq ($(CONFIG_QPEG_DECODER),yes)
129 OBJS+= qpeg.o
130endif
131ifeq ($(CONFIG_QTRLE_DECODER),yes)
132 OBJS+= qtrle.o
133endif
134ifeq ($(CONFIG_RA_144_DECODER),yes)
135 OBJS+= ra144.o
136endif
137ifeq ($(CONFIG_RA_288_DECODER),yes)
138 OBJS+= ra288.o
139endif
140ifeq ($(CONFIG_ROQ_DECODER),yes)
141 OBJS+= roqvideo.o
142endif
143ifeq ($(CONFIG_RPZA_DECODER),yes)
144 OBJS+= rpza.o
145endif
146ifneq ($(CONFIG_RV10_DECODER)$(CONFIG_RV20_DECODER)$(CONFIG_RV10_ENCODER)$(CONFIG_RV20_ENCODER),)
147 OBJS+= rv10.o
148endif
149ifeq ($(CONFIG_SHORTEN_DECODER),yes)
150 OBJS+= shorten.o
151endif
348efc18
KS
152ifneq ($(CONFIG_SMACKER_DECODER)$(CONFIG_SMACKAUD_DECODER),)
153 OBJS+= smacker.o
154endif
8b975b7c
MN
155ifeq ($(CONFIG_SMC_DECODER),yes)
156 OBJS+= smc.o
157endif
0de1318a 158ifneq ($(CONFIG_SNOW_DECODER)$(CONFIG_SNOW_ENCODER),)
8b975b7c
MN
159 OBJS+= snow.o
160endif
161ifneq ($(CONFIG_SONIC_DECODER)$(CONFIG_SONIC_ENCODER)$(CONFIG_SONIC_LS_ENCODER),)
162 OBJS+= sonic.o
163endif
164ifneq ($(CONFIG_SVQ1_DECODER)$(CONFIG_SVQ1_ENCODER),)
165 OBJS+= svq1.o
166endif
167ifeq ($(CONFIG_TRUEMOTION1_DECODER),yes)
168 OBJS+= truemotion1.o
169endif
c555392a
RT
170ifeq ($(CONFIG_TRUEMOTION2_DECODER),yes)
171 OBJS+= truemotion2.o
172endif
bf3027c8
DB
173ifeq ($(CONFIG_TRUESPEECH_DECODER),yes)
174 OBJS+= truespeech.o
175endif
a24c4a2a
AB
176ifeq ($(CONFIG_TTA_DECODER),yes)
177 OBJS+= tta.o
178endif
8b975b7c
MN
179ifeq ($(CONFIG_TSCC_DECODER),yes)
180 OBJS+= tscc.o
181endif
e0f80bd7
RD
182ifeq ($(CONFIG_CSCD_DECODER),yes)
183 OBJS+= cscd.o
517840c6 184 OBJS+= lzo.o
e0f80bd7 185endif
dfca23e3
RD
186ifeq ($(CONFIG_NUV_DECODER),yes)
187 OBJS+= nuv.o
188 OBJS+= rtjpeg.o
189 OBJS+= lzo.o
190endif
8b975b7c
MN
191ifeq ($(CONFIG_ULTI_DECODER),yes)
192 OBJS+= ulti.o
193endif
194ifneq ($(CONFIG_VC9_DECODER)$(CONFIG_WMV3_DECODER),)
195 OBJS+= vc9.o
196endif
197ifneq ($(CONFIG_VCR1_DECODER)$(CONFIG_VCR1_ENCODER),)
198 OBJS+= vcr1.o
199endif
200ifneq ($(CONFIG_VMDVIDEO_DECODER)$(CONFIG_VMDAUDIO_DECODER),)
201 OBJS+= vmdav.o
202endif
0bde73d9
MN
203ifeq ($(CONFIG_VORBIS_DECODER),yes)
204 OBJS+= vorbis.o
205endif
8b975b7c
MN
206ifneq ($(CONFIG_VP3_DECODER)$(CONFIG_THEORA_DECODER),)
207 OBJS+= vp3.o
208endif
209ifeq ($(CONFIG_VQA_DECODER),yes)
210 OBJS+= vqavideo.o
211endif
212ifneq ($(CONFIG_WMAV1_DECODER)$(CONFIG_WMAV2_DECODER),)
213 OBJS+= wmadec.o
214endif
215ifeq ($(CONFIG_WNV1_DECODER),yes)
216 OBJS+= wnv1.o
217endif
218ifeq ($(CONFIG_WS_SND1_DECODER),yes)
219 OBJS+= ws-snd1.o
220endif
221ifneq ($(CONFIG_XAN_WC3_DECODER)$(CONFIG_XAN_WC4_DECODER),)
222 OBJS+= xan.o
223endif
224ifeq ($(CONFIG_XL_DECODER),yes)
225 OBJS+= xl.o
226endif
9fa62f2a
MR
227ifeq ($(CONFIG_BMP_DECODER),yes)
228 OBJS+= bmp.o
229endif
4e114829
MM
230ifeq ($(CONFIG_MMVIDEO_DECODER),yes)
231 OBJS+= mmvideo.o
232endif
9c8d8e84
MM
233ifeq ($(CONFIG_ZMBV_DECODER),yes)
234 OBJS+= zmbv.o
235endif
9fa62f2a 236
4d4bb927 237AMROBJS=
891f64b3 238ifeq ($(AMR_NB),yes)
bc634f6f 239ifeq ($(AMR_NB_FIXED),yes)
4d4bb927 240AMROBJS= amr.o
bc634f6f
ZK
241AMREXTRALIBS+= amr/*.o
242AMRLIBS=amrlibs
243CLEANAMR=cleanamr
244else
4d4bb927
RT
245AMROBJS= amr.o
246OBJS+= amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
bc634f6f
ZK
247CLEANAMR=cleanamrfloat
248endif
891f64b3 249endif
250
9c3d33d6
MN
251ifeq ($(HAVE_PTHREADS),yes)
252OBJS+= pthread.o
253endif
254
16806499
MN
255ifeq ($(HAVE_W32THREADS),yes)
256OBJS+= w32thread.o
257endif
258
e2a5fd20
MN
259ifeq ($(HAVE_OS2THREADS),yes)
260OBJS+= os2thread.o
261endif
262
263
2450cff2
FR
264ifeq ($(HAVE_BEOSTHREADS),yes)
265OBJS+= beosthread.o
266endif
267
d663a1fd 268ifeq ($(AMR_WB),yes)
4d4bb927
RT
269AMROBJS= amr.o
270OBJS+= amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o amrwb_float/dec_gain.o \
d663a1fd
MN
271 amrwb_float/dec_if.o amrwb_float/dec_lpc.o amrwb_float/dec_main.o \
272 amrwb_float/dec_rom.o amrwb_float/dec_util.o amrwb_float/enc_acelp.o \
273 amrwb_float/enc_dtx.o amrwb_float/enc_gain.o amrwb_float/enc_if.o \
274 amrwb_float/enc_lpc.o amrwb_float/enc_main.o amrwb_float/enc_rom.o \
275 amrwb_float/enc_util.o amrwb_float/if_rom.o
90d9a1ba 276CLEANAMR=cleanamrwbfloat
d663a1fd 277endif
4d4bb927 278OBJS+= $(AMROBJS)
980fc7b8 279ASM_OBJS=
de6d9b64 280
4f1bb8a9
IK
281ifeq ($(HAVE_XVMC_ACCEL),yes)
282OBJS+= xvmcvideo.o
283endif
284
57514323 285# currently using liba52 for ac3 decoding
d771bcae 286ifeq ($(CONFIG_AC3),yes)
57514323 287OBJS+= a52dec.o
57514323
ZK
288
289# using builtin liba52 or runtime linked liba52.so.0
ff4ec49e 290ifneq ($(CONFIG_A52BIN),yes)
57514323 291OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
521221cf 292 liba52/imdct.o liba52/parse.o liba52/crc.o liba52/resample.o
d771bcae 293endif
ff4ec49e 294endif
de6d9b64 295
2cf30841 296EXTRALIBS := -L../libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)
c11c2bc2 297
23c99253
MN
298# currently using libdts for dts decoding
299ifeq ($(CONFIG_DTS),yes)
300OBJS+= dtsdec.o
fe9a734c 301CFLAGS += $(DTS_INC)
23c99253
MN
302endif
303
280bd7b7
ZK
304ifeq ($(CONFIG_FAAD),yes)
305OBJS+= faad.o
306endif
307
29d48296
MN
308ifeq ($(CONFIG_FAAC),yes)
309OBJS+= faac.o
29d48296
MN
310endif
311
1ddadfa9
AT
312ifeq ($(CONFIG_XVID),yes)
313OBJS+= xvidff.o
64b7c5b6 314OBJS+= xvid_rc.o
1ddadfa9
AT
315endif
316
6662ec29
MN
317ifeq ($(CONFIG_X264),yes)
318OBJS+= x264.o
6662ec29
MN
319endif
320
5798368b
J
321ifeq ($(CONFIG_MP3LAME),yes)
322OBJS += mp3lameaudio.o
323endif
324
5c5dea3f 325ifeq ($(CONFIG_LIBOGG),yes)
5c5dea3f 326ifeq ($(CONFIG_LIBVORBIS),yes)
81e0d0b4 327OBJS += oggvorbis.o
81e0d0b4 328endif
5c5dea3f
NB
329ifeq ($(CONFIG_LIBTHEORA), yes)
330OBJS += oggtheora.o
5c5dea3f
NB
331endif
332endif
81e0d0b4 333
bb4c2140
MN
334ifeq ($(CONFIG_LIBGSM),yes)
335OBJS += libgsm.o
bb4c2140
MN
336endif
337
de6d9b64 338# i386 mmx specific stuff
980fc7b8 339ifeq ($(TARGET_MMX),yes)
4300403e 340OBJS += i386/fdct_mmx.o i386/cputest.o \
de1ee36a 341 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
57514323 342 i386/idct_mmx.o i386/motion_est_mmx.o \
38acbc3c 343 i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \
4567b4bd 344 i386/vp3dsp_sse2.o i386/fft_3dn.o i386/fft_3dn2.o i386/snowdsp_mmx.o
84740d59
MN
345ifeq ($(CONFIG_GPL),yes)
346OBJS += i386/idct_mmx_xvid.o
347endif
a968e365
FB
348ifdef TARGET_BUILTIN_VECTOR
349i386/fft_sse.o: CFLAGS+= -msse
148beec7 350depend: CFLAGS+= -msse
a968e365 351endif
82eb4b0f
ZM
352ifdef TARGET_BUILTIN_3DNOW
353i386/fft_3dn.o: CFLAGS+= -m3dnow
354i386/fft_3dn2.o: CFLAGS+= -march=athlon
355endif
de6d9b64
FB
356endif
357
3d03c0a2
FB
358# armv4l specific stuff
359ifeq ($(TARGET_ARCH_ARMV4L),yes)
6ad1fa5a 360ASM_OBJS += armv4l/jrevdct_arm.o armv4l/simple_idct_arm.o armv4l/dsputil_arm_s.o
676e200c 361OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
6ad1fa5a
BR
362ifeq ($(TARGET_IWMMXT),yes)
363OBJS += armv4l/dsputil_iwmmxt.o armv4l/mpegvideo_iwmmxt.o
364endif
3d03c0a2
FB
365endif
366
c34270f5
FB
367# sun mediaLib specific stuff
368# currently only works when libavcodec is used in mplayer
369ifeq ($(HAVE_MLIB),yes)
370OBJS += mlib/dsputil_mlib.o
371CFLAGS += $(MLIB_INC)
372endif
373
6ad1fa5a
BR
374# Intel IPP specific stuff
375# currently only works when libavcodec is used in mplayer
376ifeq ($(HAVE_IPP),yes)
377CFLAGS += $(IPP_INC)
378endif
379
1e98dffb
NK
380# alpha specific stuff
381ifeq ($(TARGET_ARCH_ALPHA),yes)
8b313a47
FH
382OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
383 alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
f9bb4bdf 384ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
647b610c 385CFLAGS += -fforce-addr
1e98dffb
NK
386endif
387
59925ef2 388ifeq ($(TARGET_ARCH_POWERPC),yes)
05c4072b 389OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
ab6c65f6
BF
390endif
391
d46aba26 392ifeq ($(TARGET_MMI),yes)
5917d17c 393OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
d46aba26
LS
394endif
395
ab6c65f6 396ifeq ($(TARGET_ALTIVEC),yes)
8d268a7d 397OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
a6a12a8a 398 ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o \
22b48b85 399 ppc/dsputil_h264_altivec.o ppc/dsputil_snow_altivec.o
59925ef2
BF
400endif
401
0c6bd2ea
B
402ifeq ($(TARGET_ARCH_SH4),yes)
403OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
404endif
405
bb476ff3 406ifeq ($(TARGET_ARCH_SPARC),yes)
44f54ceb 407OBJS+=sparc/dsputil_vis.o
bb476ff3 408sparc/%.o: sparc/%.c
115329f1 409 $(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $<
bb476ff3 410endif
980fc7b8 411
4bdd05e7 412NAME=avcodec
8b2121e3 413SUBDIR=libavcodec
c11c2bc2 414LIBAVUTIL= $(SRC_PATH)/libavutil/$(LIBPREF)avutil$(LIBSUF)
0fd94442 415ifeq ($(BUILD_SHARED),yes)
f3b60109
DB
416LIBVERSION=$(LAVCVERSION)
417LIBMAJOR=$(LAVCMAJOR)
0fd94442 418endif
6d2abd6b 419TESTS= imgresample-test dct-test motion-test fft-test
de6d9b64 420
8b2121e3
MR
421EXTRAOBJS = $(AMREXTRALIBS)
422
423include $(SRC_PATH)/common.mak
424
425$(LIB): $(AMRLIBS)
ff4ec49e 426
bc634f6f
ZK
427amrlibs:
428 $(MAKE) -C amr spclib fipoplib
429
c10e9f70 430tests: apiexample cpuid_test $(TESTS)
de6d9b64 431
de6d9b64
FB
432dsputil.o: dsputil.c dsputil.h
433
8b2121e3
MR
434clean:: $(CLEANAMR)
435 rm -f \
98013cc1 436 i386/*.o i386/*~ \
3d03c0a2 437 armv4l/*.o armv4l/*~ \
c34270f5 438 mlib/*.o mlib/*~ \
1e98dffb 439 alpha/*.o alpha/*~ \
59925ef2 440 ppc/*.o ppc/*~ \
d46aba26 441 ps2/*.o ps2/*~ \
0c6bd2ea 442 sh4/*.o sh4/*~ \
bb476ff3 443 sparc/*.o sparc/*~ \
57514323
ZK
444 liba52/*.o liba52/*~ \
445 apiexample $(TESTS)
de6d9b64 446
bc634f6f
ZK
447cleanamr:
448 $(MAKE) -C amr clean
449
450cleanamrfloat:
451 rm -f amr_float/*.o
452
d663a1fd
MN
453cleanamrwbfloat:
454 $(MAKE) -C amrwb_float -f makefile.gcc clean
455
de6d9b64
FB
456# api example program
457apiexample: apiexample.c $(LIB)
dc9cc5ed 458 $(CC) $(CFLAGS) -o $@ $< $(LIB) $(LIBAVUTIL) $(EXTRALIBS)
de6d9b64 459
c10e9f70
NK
460# cpuid test
461cpuid_test: i386/cputest.c
462 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
463
de6d9b64
FB
464# testing progs
465
466imgresample-test: imgresample.c
6acce86b 467 $(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
de6d9b64 468
9ebc63a9 469dct-test: dct-test.o fdctref.o $(LIB)
434df899 470 $(CC) -o $@ $^ -lm $(LIBAVUTIL)
d771bcae 471
4300403e 472motion-test: motion_test.o $(LIB)
6acce86b 473 $(CC) -o $@ $^ -lm
4300403e 474
923ceff8 475fft-test: fft-test.o $(LIB)
c11c2bc2 476 $(CC) -o $@ $^ $(LIBAVUTIL) -lm