3 # (c) 2000-2005 Fabrice Bellard
7 # NOTE: -I.. is needed to include config.h
8 CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavutil -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE $(AMR_CFLAGS)
10 OBJS= bitstream.o utils.o mem.o allcodecs.o \
11 mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
12 mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o \
13 motion_est.o imgconvert.o imgresample.o \
14 mpeg12.o mpegaudiodec.o pcm.o simple_idct.o \
15 ratecontrol.o adpcm.o eval.o error_resilience.o \
16 fft.o mdct.o raw.o golomb.o cabac.o\
17 dpcm.o adx.o faandct.o parser.o g726.o \
18 vp3dsp.o h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o \
23 ifeq ($(CONFIG_AASC_DECODER),yes)
26 ifeq ($(CONFIG_ALAC_DECODER),yes)
29 ifneq ($(CONFIG_ASV1_DECODER)$(CONFIG_ASV1_ENCODER)$(CONFIG_ASV2_DECODER)$(CONFIG_ASV2_ENCODER),)
32 ifeq ($(CONFIG_AVS_DECODER),yes)
35 ifeq ($(CONFIG_CINEPAK_DECODER),yes)
38 ifeq ($(CONFIG_COOK_DECODER),yes)
41 ifneq ($(CONFIG_CLJR_DECODER)$(CONFIG_CLJR_ENCODER),)
44 ifeq ($(CONFIG_CYUV_DECODER),yes)
47 ifeq ($(CONFIG_DVBSUB_DECODER),yes)
50 ifeq ($(CONFIG_DVBSUB_ENCODER),yes)
53 ifeq ($(CONFIG_DVDSUB_DECODER),yes)
56 ifeq ($(CONFIG_DVDSUB_ENCODER),yes)
59 ifneq ($(CONFIG_DVVIDEO_DECODER)$(CONFIG_DVVIDEO_ENCODER),)
62 ifeq ($(CONFIG_EIGHTBPS_DECODER),yes)
65 ifneq ($(CONFIG_FFV1_DECODER)$(CONFIG_FFV1_ENCODER),)
68 ifeq ($(CONFIG_FLAC_DECODER),yes)
71 ifeq ($(CONFIG_FLAC_ENCODER),yes)
74 ifeq ($(CONFIG_FLIC_DECODER),yes)
77 ifeq ($(CONFIG_FOURXM_DECODER),yes)
80 ifeq ($(CONFIG_FRAPS_DECODER),yes)
83 ifneq ($(CONFIG_H261_DECODER)$(CONFIG_H261_ENCODER),)
86 ifneq ($(CONFIG_H264_DECODER)$(CONFIG_SVQ3_DECODER),)
89 ifneq ($(CONFIG_HUFFYUV_DECODER)$(CONFIG_HUFFYUV_ENCODER)$(CONFIG_FFVHUFF_DECODER)$(CONFIG_FFVHUFF_ENCODER),)
92 ifeq ($(CONFIG_IDCIN_DECODER),yes)
95 ifeq ($(CONFIG_INDEO2_DECODER),yes)
98 ifeq ($(CONFIG_INDEO3_DECODER),yes)
101 ifeq ($(CONFIG_INTERPLAY_VIDEO_DECODER),yes)
102 OBJS+= interplayvideo.o
104 ifeq ($(CONFIG_KMVC_DECODER),yes)
107 ifneq ($(CONFIG_MSZH_DECODER)$(CONFIG_ZLIB_DECODER)$(CONFIG_ZLIB_ENCODER),)
110 ifeq ($(CONFIG_LOCO_DECODER),yes)
113 ifneq ($(CONFIG_MACE3_DECODER)$(CONFIG_MACE6_DECODER),)
116 ifeq ($(CONFIG_MSRLE_DECODER),yes)
119 ifeq ($(CONFIG_MSVIDEO1_DECODER),yes)
122 ifneq ($(CONFIG_PNG_DECODER)$(CONFIG_PNG_ENCODER),)
125 ifeq ($(CONFIG_QDM2_DECODER),yes)
128 ifeq ($(CONFIG_QDRAW_DECODER),yes)
131 ifeq ($(CONFIG_QPEG_DECODER),yes)
134 ifeq ($(CONFIG_QTRLE_DECODER),yes)
137 ifeq ($(CONFIG_RA_144_DECODER),yes)
140 ifeq ($(CONFIG_RA_288_DECODER),yes)
143 ifeq ($(CONFIG_ROQ_DECODER),yes)
146 ifeq ($(CONFIG_RPZA_DECODER),yes)
149 ifneq ($(CONFIG_RV10_DECODER)$(CONFIG_RV20_DECODER)$(CONFIG_RV10_ENCODER)$(CONFIG_RV20_ENCODER),)
152 ifeq ($(CONFIG_SHORTEN_DECODER),yes)
155 ifneq ($(CONFIG_SMACKER_DECODER)$(CONFIG_SMACKAUD_DECODER),)
158 ifeq ($(CONFIG_SMC_DECODER),yes)
161 ifneq ($(CONFIG_SNOW_DECODER)$(CONFIG_SNOW_ENCODER),)
164 ifneq ($(CONFIG_SONIC_DECODER)$(CONFIG_SONIC_ENCODER)$(CONFIG_SONIC_LS_ENCODER),)
167 ifneq ($(CONFIG_SVQ1_DECODER)$(CONFIG_SVQ1_ENCODER),)
170 ifeq ($(CONFIG_TRUEMOTION1_DECODER),yes)
173 ifeq ($(CONFIG_TRUEMOTION2_DECODER),yes)
176 ifeq ($(CONFIG_TRUESPEECH_DECODER),yes)
179 ifeq ($(CONFIG_TTA_DECODER),yes)
182 ifeq ($(CONFIG_TSCC_DECODER),yes)
185 ifeq ($(CONFIG_CSCD_DECODER),yes)
189 ifeq ($(CONFIG_NUV_DECODER),yes)
194 ifeq ($(CONFIG_ULTI_DECODER),yes)
197 ifneq ($(CONFIG_VC1_DECODER)$(CONFIG_WMV3_DECODER),)
200 ifneq ($(CONFIG_VCR1_DECODER)$(CONFIG_VCR1_ENCODER),)
203 ifneq ($(CONFIG_VMDVIDEO_DECODER)$(CONFIG_VMDAUDIO_DECODER),)
206 ifeq ($(CONFIG_VORBIS_DECODER),yes)
209 ifneq ($(CONFIG_VP3_DECODER)$(CONFIG_THEORA_DECODER),)
212 ifeq ($(CONFIG_VQA_DECODER),yes)
215 ifneq ($(CONFIG_WMAV1_DECODER)$(CONFIG_WMAV2_DECODER),)
218 ifeq ($(CONFIG_WNV1_DECODER),yes)
221 ifeq ($(CONFIG_WS_SND1_DECODER),yes)
224 ifneq ($(CONFIG_XAN_WC3_DECODER)$(CONFIG_XAN_WC4_DECODER),)
227 ifeq ($(CONFIG_XL_DECODER),yes)
230 ifeq ($(CONFIG_BMP_DECODER),yes)
233 ifeq ($(CONFIG_MMVIDEO_DECODER),yes)
236 ifeq ($(CONFIG_ZMBV_DECODER),yes)
239 ifeq ($(CONFIG_FLASHSV_DECODER),yes)
249 OBJS+= amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
252 ifeq ($(AMR_NB_FIXED),yes)
258 OBJS+= amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o amrwb_float/dec_gain.o \
259 amrwb_float/dec_if.o amrwb_float/dec_lpc.o amrwb_float/dec_main.o \
260 amrwb_float/dec_rom.o amrwb_float/dec_util.o amrwb_float/enc_acelp.o \
261 amrwb_float/enc_dtx.o amrwb_float/enc_gain.o amrwb_float/enc_if.o \
262 amrwb_float/enc_lpc.o amrwb_float/enc_main.o amrwb_float/enc_rom.o \
263 amrwb_float/enc_util.o amrwb_float/if_rom.o
267 ifeq ($(HAVE_PTHREADS),yes)
271 ifeq ($(HAVE_W32THREADS),yes)
275 ifeq ($(HAVE_OS2THREADS),yes)
280 ifeq ($(HAVE_BEOSTHREADS),yes)
286 ifeq ($(HAVE_XVMC_ACCEL),yes)
290 # currently using liba52 for ac3 decoding
291 ifeq ($(CONFIG_AC3),yes)
294 # using builtin liba52 or runtime linked liba52.so.0
295 ifneq ($(CONFIG_A52BIN),yes)
296 OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
297 liba52/imdct.o liba52/parse.o liba52/crc.o liba52/resample.o
301 EXTRALIBS := -L../libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)
303 # currently using libdts for dts decoding
304 ifeq ($(CONFIG_DTS),yes)
309 ifeq ($(CONFIG_FAAD),yes)
313 ifeq ($(CONFIG_FAAC),yes)
317 ifeq ($(CONFIG_XVID),yes)
322 ifeq ($(CONFIG_X264),yes)
326 ifeq ($(CONFIG_MP3LAME),yes)
327 OBJS += mp3lameaudio.o
330 ifeq ($(CONFIG_LIBOGG),yes)
331 ifeq ($(CONFIG_LIBVORBIS),yes)
334 ifeq ($(CONFIG_LIBTHEORA), yes)
339 ifeq ($(CONFIG_LIBGSM),yes)
343 # i386 mmx specific stuff
344 ifeq ($(TARGET_MMX),yes)
345 OBJS += i386/fdct_mmx.o i386/cputest.o \
346 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
347 i386/idct_mmx.o i386/motion_est_mmx.o \
348 i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \
349 i386/vp3dsp_sse2.o i386/fft_3dn.o i386/fft_3dn2.o i386/snowdsp_mmx.o
350 ifeq ($(CONFIG_GPL),yes)
351 OBJS += i386/idct_mmx_xvid.o
353 ifeq ($(TARGET_BUILTIN_VECTOR),yes)
354 i386/fft_sse.o: CFLAGS+= -msse
355 depend: CFLAGS+= -msse
357 ifeq ($(TARGET_BUILTIN_3DNOW),yes)
358 i386/fft_3dn.o: CFLAGS+= -m3dnow
359 ifeq ($(TARGET_ARCH_X86),yes)
360 i386/fft_3dn2.o: CFLAGS+= -march=athlon
362 ifeq ($(TARGET_ARCH_X86_64),yes)
363 i386/fft_3dn2.o: CFLAGS+= -march=k8
368 # armv4l specific stuff
369 ifeq ($(TARGET_ARCH_ARMV4L),yes)
370 ASM_OBJS += armv4l/jrevdct_arm.o armv4l/simple_idct_arm.o armv4l/dsputil_arm_s.o
371 OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
372 ifeq ($(TARGET_IWMMXT),yes)
373 OBJS += armv4l/dsputil_iwmmxt.o armv4l/mpegvideo_iwmmxt.o
377 # sun mediaLib specific stuff
378 # currently only works when libavcodec is used in mplayer
379 ifeq ($(HAVE_MLIB),yes)
380 OBJS += mlib/dsputil_mlib.o
381 CFLAGS += $(MLIB_INC)
384 # Intel IPP specific stuff
385 # currently only works when libavcodec is used in mplayer
386 ifeq ($(HAVE_IPP),yes)
390 # alpha specific stuff
391 ifeq ($(TARGET_ARCH_ALPHA),yes)
392 OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
393 alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
394 ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
395 CFLAGS += -fforce-addr
398 ifeq ($(TARGET_ARCH_POWERPC),yes)
399 OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
402 ifeq ($(TARGET_MMI),yes)
403 OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
406 ifeq ($(TARGET_ALTIVEC),yes)
407 OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
408 ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o \
409 ppc/dsputil_h264_altivec.o ppc/dsputil_snow_altivec.o
412 ifeq ($(TARGET_ARCH_SH4),yes)
413 OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
416 ifeq ($(TARGET_ARCH_SPARC),yes)
417 OBJS+=sparc/dsputil_vis.o
419 $(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $<
423 LIBAVUTIL= $(SRC_PATH)/libavutil/$(LIBPREF)avutil$(LIBSUF)
424 ifeq ($(BUILD_SHARED),yes)
425 LIBVERSION=$(LAVCVERSION)
426 LIBMAJOR=$(LAVCMAJOR)
428 TESTS= imgresample-test dct-test motion-test fft-test
430 include $(SRC_PATH)/common.mak
433 $(MAKE) -C amr spclib fipoplib
435 tests: apiexample cpuid_test $(TESTS)
437 dsputil.o: dsputil.c dsputil.h
442 armv4l/*.o armv4l/*~ \
449 liba52/*.o liba52/*~ \
452 -$(MAKE) -C amr clean
453 -$(MAKE) -C amrwb_float -f makefile.gcc clean
455 # api example program
456 apiexample: apiexample.c $(LIB)
457 $(CC) $(CFLAGS) -o $@ $< $(LIB) $(LIBAVUTIL) $(EXTRALIBS)
460 cpuid_test: i386/cputest.c
461 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
465 imgresample-test: imgresample.c
466 $(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
468 dct-test: dct-test.o fdctref.o $(LIB)
469 $(CC) -o $@ $^ -lm $(LIBAVUTIL)
471 motion-test: motion_test.o $(LIB)
474 fft-test: fft-test.o $(LIB)
475 $(CC) -o $@ $^ $(LIBAVUTIL) -lm