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