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