use ifeq(...,yes) instead of ifdef
[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
0919e788
BL
236ifeq ($(CONFIG_FLASHSV_DECODER),yes)
237 OBJS+= flashsv.o
238endif
9fa62f2a 239
e0fb7e5b 240
60827a1a
DB
241ifeq ($(AMR),yes)
242OBJS+= amr.o
243endif
e0fb7e5b 244
891f64b3 245ifeq ($(AMR_NB),yes)
6eb07e73 246OBJS+= amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
6eb07e73
DB
247endif
248
bc634f6f 249ifeq ($(AMR_NB_FIXED),yes)
3ed410a6
DB
250EXTRAOBJS += amr/*.o
251EXTRADEPS=amrlibs
891f64b3 252endif
253
e0fb7e5b 254ifeq ($(AMR_WB),yes)
e0fb7e5b
DB
255OBJS+= amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o amrwb_float/dec_gain.o \
256 amrwb_float/dec_if.o amrwb_float/dec_lpc.o amrwb_float/dec_main.o \
257 amrwb_float/dec_rom.o amrwb_float/dec_util.o amrwb_float/enc_acelp.o \
258 amrwb_float/enc_dtx.o amrwb_float/enc_gain.o amrwb_float/enc_if.o \
259 amrwb_float/enc_lpc.o amrwb_float/enc_main.o amrwb_float/enc_rom.o \
260 amrwb_float/enc_util.o amrwb_float/if_rom.o
e0fb7e5b
DB
261endif
262
e0fb7e5b 263
9c3d33d6
MN
264ifeq ($(HAVE_PTHREADS),yes)
265OBJS+= pthread.o
266endif
267
16806499
MN
268ifeq ($(HAVE_W32THREADS),yes)
269OBJS+= w32thread.o
270endif
271
e2a5fd20
MN
272ifeq ($(HAVE_OS2THREADS),yes)
273OBJS+= os2thread.o
274endif
275
276
2450cff2
FR
277ifeq ($(HAVE_BEOSTHREADS),yes)
278OBJS+= beosthread.o
279endif
280
980fc7b8 281ASM_OBJS=
de6d9b64 282
4f1bb8a9
IK
283ifeq ($(HAVE_XVMC_ACCEL),yes)
284OBJS+= xvmcvideo.o
285endif
286
57514323 287# currently using liba52 for ac3 decoding
d771bcae 288ifeq ($(CONFIG_AC3),yes)
57514323 289OBJS+= a52dec.o
57514323
ZK
290
291# using builtin liba52 or runtime linked liba52.so.0
ff4ec49e 292ifneq ($(CONFIG_A52BIN),yes)
57514323 293OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
521221cf 294 liba52/imdct.o liba52/parse.o liba52/crc.o liba52/resample.o
d771bcae 295endif
ff4ec49e 296endif
de6d9b64 297
2cf30841 298EXTRALIBS := -L../libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)
c11c2bc2 299
23c99253
MN
300# currently using libdts for dts decoding
301ifeq ($(CONFIG_DTS),yes)
302OBJS+= dtsdec.o
fe9a734c 303CFLAGS += $(DTS_INC)
23c99253
MN
304endif
305
280bd7b7
ZK
306ifeq ($(CONFIG_FAAD),yes)
307OBJS+= faad.o
308endif
309
29d48296
MN
310ifeq ($(CONFIG_FAAC),yes)
311OBJS+= faac.o
29d48296
MN
312endif
313
1ddadfa9
AT
314ifeq ($(CONFIG_XVID),yes)
315OBJS+= xvidff.o
64b7c5b6 316OBJS+= xvid_rc.o
1ddadfa9
AT
317endif
318
6662ec29
MN
319ifeq ($(CONFIG_X264),yes)
320OBJS+= x264.o
6662ec29
MN
321endif
322
5798368b
J
323ifeq ($(CONFIG_MP3LAME),yes)
324OBJS += mp3lameaudio.o
325endif
326
5c5dea3f 327ifeq ($(CONFIG_LIBOGG),yes)
5c5dea3f 328ifeq ($(CONFIG_LIBVORBIS),yes)
81e0d0b4 329OBJS += oggvorbis.o
81e0d0b4 330endif
5c5dea3f
NB
331ifeq ($(CONFIG_LIBTHEORA), yes)
332OBJS += oggtheora.o
5c5dea3f
NB
333endif
334endif
81e0d0b4 335
bb4c2140
MN
336ifeq ($(CONFIG_LIBGSM),yes)
337OBJS += libgsm.o
bb4c2140
MN
338endif
339
de6d9b64 340# i386 mmx specific stuff
980fc7b8 341ifeq ($(TARGET_MMX),yes)
4300403e 342OBJS += i386/fdct_mmx.o i386/cputest.o \
de1ee36a 343 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
57514323 344 i386/idct_mmx.o i386/motion_est_mmx.o \
38acbc3c 345 i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \
4567b4bd 346 i386/vp3dsp_sse2.o i386/fft_3dn.o i386/fft_3dn2.o i386/snowdsp_mmx.o
84740d59
MN
347ifeq ($(CONFIG_GPL),yes)
348OBJS += i386/idct_mmx_xvid.o
349endif
87318d69 350ifeq ($(TARGET_BUILTIN_VECTOR),yes)
a968e365 351i386/fft_sse.o: CFLAGS+= -msse
148beec7 352depend: CFLAGS+= -msse
a968e365 353endif
87318d69 354ifeq ($(TARGET_BUILTIN_3DNOW),yes)
82eb4b0f 355i386/fft_3dn.o: CFLAGS+= -m3dnow
c2f69579
GP
356ifeq ($(TARGET_ARCH_X86),yes)
357i386/fft_3dn2.o: CFLAGS+= -march=athlon
358endif
359ifeq ($(TARGET_ARCH_X86_64),yes)
360i386/fft_3dn2.o: CFLAGS+= -march=k8
361endif
82eb4b0f 362endif
de6d9b64
FB
363endif
364
3d03c0a2
FB
365# armv4l specific stuff
366ifeq ($(TARGET_ARCH_ARMV4L),yes)
6ad1fa5a 367ASM_OBJS += armv4l/jrevdct_arm.o armv4l/simple_idct_arm.o armv4l/dsputil_arm_s.o
676e200c 368OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
6ad1fa5a
BR
369ifeq ($(TARGET_IWMMXT),yes)
370OBJS += armv4l/dsputil_iwmmxt.o armv4l/mpegvideo_iwmmxt.o
371endif
3d03c0a2
FB
372endif
373
c34270f5
FB
374# sun mediaLib specific stuff
375# currently only works when libavcodec is used in mplayer
376ifeq ($(HAVE_MLIB),yes)
377OBJS += mlib/dsputil_mlib.o
378CFLAGS += $(MLIB_INC)
379endif
380
6ad1fa5a
BR
381# Intel IPP specific stuff
382# currently only works when libavcodec is used in mplayer
383ifeq ($(HAVE_IPP),yes)
384CFLAGS += $(IPP_INC)
385endif
386
1e98dffb
NK
387# alpha specific stuff
388ifeq ($(TARGET_ARCH_ALPHA),yes)
8b313a47
FH
389OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
390 alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
f9bb4bdf 391ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
647b610c 392CFLAGS += -fforce-addr
1e98dffb
NK
393endif
394
59925ef2 395ifeq ($(TARGET_ARCH_POWERPC),yes)
05c4072b 396OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
ab6c65f6
BF
397endif
398
d46aba26 399ifeq ($(TARGET_MMI),yes)
5917d17c 400OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
d46aba26
LS
401endif
402
ab6c65f6 403ifeq ($(TARGET_ALTIVEC),yes)
8d268a7d 404OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
a6a12a8a 405 ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o \
22b48b85 406 ppc/dsputil_h264_altivec.o ppc/dsputil_snow_altivec.o
59925ef2
BF
407endif
408
0c6bd2ea
B
409ifeq ($(TARGET_ARCH_SH4),yes)
410OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
411endif
412
bb476ff3 413ifeq ($(TARGET_ARCH_SPARC),yes)
44f54ceb 414OBJS+=sparc/dsputil_vis.o
bb476ff3 415sparc/%.o: sparc/%.c
115329f1 416 $(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $<
bb476ff3 417endif
980fc7b8 418
4bdd05e7 419NAME=avcodec
c11c2bc2 420LIBAVUTIL= $(SRC_PATH)/libavutil/$(LIBPREF)avutil$(LIBSUF)
0fd94442 421ifeq ($(BUILD_SHARED),yes)
f3b60109
DB
422LIBVERSION=$(LAVCVERSION)
423LIBMAJOR=$(LAVCMAJOR)
0fd94442 424endif
6d2abd6b 425TESTS= imgresample-test dct-test motion-test fft-test
de6d9b64 426
8b2121e3
MR
427include $(SRC_PATH)/common.mak
428
bc634f6f
ZK
429amrlibs:
430 $(MAKE) -C amr spclib fipoplib
431
c10e9f70 432tests: apiexample cpuid_test $(TESTS)
de6d9b64 433
de6d9b64
FB
434dsputil.o: dsputil.c dsputil.h
435
c7f1a2f5 436clean::
8b2121e3 437 rm -f \
98013cc1 438 i386/*.o i386/*~ \
3d03c0a2 439 armv4l/*.o armv4l/*~ \
c34270f5 440 mlib/*.o mlib/*~ \
1e98dffb 441 alpha/*.o alpha/*~ \
59925ef2 442 ppc/*.o ppc/*~ \
d46aba26 443 ps2/*.o ps2/*~ \
0c6bd2ea 444 sh4/*.o sh4/*~ \
bb476ff3 445 sparc/*.o sparc/*~ \
57514323 446 liba52/*.o liba52/*~ \
c7f1a2f5 447 amr_float/*.o \
57514323 448 apiexample $(TESTS)
215e46e6
DB
449 -$(MAKE) -C amr clean
450 -$(MAKE) -C amrwb_float -f makefile.gcc clean
d663a1fd 451
de6d9b64
FB
452# api example program
453apiexample: apiexample.c $(LIB)
dc9cc5ed 454 $(CC) $(CFLAGS) -o $@ $< $(LIB) $(LIBAVUTIL) $(EXTRALIBS)
de6d9b64 455
c10e9f70
NK
456# cpuid test
457cpuid_test: i386/cputest.c
458 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
459
de6d9b64
FB
460# testing progs
461
462imgresample-test: imgresample.c
6acce86b 463 $(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
de6d9b64 464
9ebc63a9 465dct-test: dct-test.o fdctref.o $(LIB)
434df899 466 $(CC) -o $@ $^ -lm $(LIBAVUTIL)
d771bcae 467
4300403e 468motion-test: motion_test.o $(LIB)
6acce86b 469 $(CC) -o $@ $^ -lm
4300403e 470
923ceff8 471fft-test: fft-test.o $(LIB)
c11c2bc2 472 $(CC) -o $@ $^ $(LIBAVUTIL) -lm