Makefile 13 KB
Newer Older
1 2
#
# libavcodec Makefile
3
# (c) 2000-2005 Fabrice Bellard
4
#
5 6
include ../config.mak

glantau's avatar
glantau committed
7
# NOTE: -I.. is needed to include config.h
diego's avatar
diego committed
8 9
CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavutil \
       -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE $(AMR_CFLAGS)
glantau's avatar
glantau committed
10

11
OBJS= bitstream.o utils.o mem.o allcodecs.o \
michaelni's avatar
michaelni committed
12
      mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
13
      mjpeg.o resample.o resample2.o dsputil.o \
michaelni's avatar
michaelni committed
14
      motion_est.o imgconvert.o imgresample.o \
iive's avatar
iive committed
15
      mpeg12.o mpegaudiodec.o pcm.o simple_idct.o \
michael's avatar
michael committed
16 17
      ratecontrol.o adpcm.o eval.o error_resilience.o \
      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 21 22
      opt.o \
      bitstream_filter.o \

bellard's avatar
bellard committed
23

24
HEADERS = avcodec.h
25

mru's avatar
mru committed
26 27 28 29 30 31 32 33
OBJS-$(CONFIG_AASC_DECODER)            += aasc.o
OBJS-$(CONFIG_AC3_ENCODER)             += ac3enc.o
OBJS-$(CONFIG_ALAC_DECODER)            += alac.o
OBJS-$(CONFIG_ASV1_DECODER)            += asv1.o
OBJS-$(CONFIG_ASV1_ENCODER)            += asv1.o
OBJS-$(CONFIG_ASV2_DECODER)            += asv1.o
OBJS-$(CONFIG_ASV2_ENCODER)            += asv1.o
OBJS-$(CONFIG_AVS_DECODER)             += avs.o
34
OBJS-$(CONFIG_BMP_DECODER)             += bmp.o
mru's avatar
mru committed
35 36 37 38
OBJS-$(CONFIG_CAVS_DECODER)            += cavs.o cavsdsp.o
OBJS-$(CONFIG_CINEPAK_DECODER)         += cinepak.o
OBJS-$(CONFIG_CLJR_DECODER)            += cljr.o
OBJS-$(CONFIG_CLJR_ENCODER)            += cljr.o
39 40
OBJS-$(CONFIG_COOK_DECODER)            += cook.o
OBJS-$(CONFIG_CSCD_DECODER)            += cscd.o lzo.o
mru's avatar
mru committed
41 42 43 44 45 46 47 48 49 50
OBJS-$(CONFIG_CYUV_DECODER)            += cyuv.o
OBJS-$(CONFIG_DVBSUB_DECODER)          += dvbsubdec.o
OBJS-$(CONFIG_DVBSUB_ENCODER)          += dvbsub.o
OBJS-$(CONFIG_DVDSUB_DECODER)          += dvdsub.o
OBJS-$(CONFIG_DVDSUB_ENCODER)          += dvdsubenc.o
OBJS-$(CONFIG_DVVIDEO_DECODER)         += dv.o
OBJS-$(CONFIG_DVVIDEO_ENCODER)         += dv.o
OBJS-$(CONFIG_EIGHTBPS_DECODER)        += 8bps.o
OBJS-$(CONFIG_FFV1_DECODER)            += ffv1.o
OBJS-$(CONFIG_FFV1_ENCODER)            += ffv1.o
51 52
OBJS-$(CONFIG_FFVHUFF_DECODER)         += huffyuv.o
OBJS-$(CONFIG_FFVHUFF_ENCODER)         += huffyuv.o
mru's avatar
mru committed
53 54
OBJS-$(CONFIG_FLAC_DECODER)            += flac.o
OBJS-$(CONFIG_FLAC_ENCODER)            += flacenc.o
55
OBJS-$(CONFIG_FLASHSV_DECODER)         += flashsv.o
mru's avatar
mru committed
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
OBJS-$(CONFIG_FLIC_DECODER)            += flicvideo.o
OBJS-$(CONFIG_FOURXM_DECODER)          += 4xm.o
OBJS-$(CONFIG_FRAPS_DECODER)           += fraps.o
OBJS-$(CONFIG_H261_DECODER)            += h261.o
OBJS-$(CONFIG_H261_ENCODER)            += h261.o
OBJS-$(CONFIG_H264_DECODER)            += h264.o
OBJS-$(CONFIG_HUFFYUV_DECODER)         += huffyuv.o
OBJS-$(CONFIG_HUFFYUV_ENCODER)         += huffyuv.o
OBJS-$(CONFIG_IDCIN_DECODER)           += idcinvideo.o
OBJS-$(CONFIG_INDEO2_DECODER)          += indeo2.o
OBJS-$(CONFIG_INDEO3_DECODER)          += indeo3.o
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
OBJS-$(CONFIG_KMVC_DECODER)            += kmvc.o
OBJS-$(CONFIG_LOCO_DECODER)            += loco.o
OBJS-$(CONFIG_MACE3_DECODER)           += mace.o
OBJS-$(CONFIG_MACE6_DECODER)           += mace.o
72
OBJS-$(CONFIG_MMVIDEO_DECODER)         += mmvideo.o
mru's avatar
mru committed
73 74 75
OBJS-$(CONFIG_MP2_ENCODER)             += mpegaudio.o
OBJS-$(CONFIG_MSRLE_DECODER)           += msrle.o
OBJS-$(CONFIG_MSVIDEO1_DECODER)        += msvideo1.o
76 77
OBJS-$(CONFIG_MSZH_DECODER)            += lcl.o
OBJS-$(CONFIG_NUV_DECODER)             += nuv.o rtjpeg.o lzo.o
mru's avatar
mru committed
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
OBJS-$(CONFIG_PNG_DECODER)             += png.o
OBJS-$(CONFIG_PNG_ENCODER)             += png.o
OBJS-$(CONFIG_QDM2_DECODER)            += qdm2.o
OBJS-$(CONFIG_QDRAW_DECODER)           += qdrw.o
OBJS-$(CONFIG_QPEG_DECODER)            += qpeg.o
OBJS-$(CONFIG_QTRLE_DECODER)           += qtrle.o
OBJS-$(CONFIG_RA_144_DECODER)          += ra144.o
OBJS-$(CONFIG_RA_288_DECODER)          += ra288.o
OBJS-$(CONFIG_ROQ_DECODER)             += roqvideo.o
OBJS-$(CONFIG_RPZA_DECODER)            += rpza.o
OBJS-$(CONFIG_RV10_DECODER)            += rv10.o
OBJS-$(CONFIG_RV10_ENCODER)            += rv10.o
OBJS-$(CONFIG_RV20_DECODER)            += rv10.o
OBJS-$(CONFIG_RV20_ENCODER)            += rv10.o
OBJS-$(CONFIG_SHORTEN_DECODER)         += shorten.o
OBJS-$(CONFIG_SMACKAUD_DECODER)        += smacker.o
94
OBJS-$(CONFIG_SMACKER_DECODER)         += smacker.o
mru's avatar
mru committed
95 96 97 98 99 100 101 102
OBJS-$(CONFIG_SMC_DECODER)             += smc.o
OBJS-$(CONFIG_SNOW_DECODER)            += snow.o
OBJS-$(CONFIG_SNOW_ENCODER)            += snow.o
OBJS-$(CONFIG_SONIC_DECODER)           += sonic.o
OBJS-$(CONFIG_SONIC_ENCODER)           += sonic.o
OBJS-$(CONFIG_SONIC_LS_DECODER)        += sonic.o
OBJS-$(CONFIG_SVQ1_DECODER)            += svq1.o
OBJS-$(CONFIG_SVQ1_ENCODER)            += svq1.o
103 104
OBJS-$(CONFIG_SVQ3_DECODER)            += h264.o
OBJS-$(CONFIG_THEORA_DECODER)          += vp3.o
mru's avatar
mru committed
105 106 107 108
OBJS-$(CONFIG_TRUEMOTION1_DECODER)     += truemotion1.o
OBJS-$(CONFIG_TRUEMOTION2_DECODER)     += truemotion2.o
OBJS-$(CONFIG_TRUESPEECH_DECODER)      += truespeech.o
OBJS-$(CONFIG_TSCC_DECODER)            += tscc.o
109
OBJS-$(CONFIG_TTA_DECODER)             += tta.o
mru's avatar
mru committed
110 111 112 113 114
OBJS-$(CONFIG_ULTI_DECODER)            += ulti.o
OBJS-$(CONFIG_VC1_DECODER)             += vc1.o
OBJS-$(CONFIG_VCR1_DECODER)            += vcr1.o
OBJS-$(CONFIG_VCR1_ENCODER)            += vcr1.o
OBJS-$(CONFIG_VMDAUDIO_DECODER)        += vmdav.o
115
OBJS-$(CONFIG_VMDVIDEO_DECODER)        += vmdav.o
mru's avatar
mru committed
116 117 118 119 120
OBJS-$(CONFIG_VORBIS_DECODER)          += vorbis.o
OBJS-$(CONFIG_VP3_DECODER)             += vp3.o
OBJS-$(CONFIG_VQA_DECODER)             += vqavideo.o
OBJS-$(CONFIG_WMAV1_DECODER)           += wmadec.o
OBJS-$(CONFIG_WMAV2_DECODER)           += wmadec.o
121
OBJS-$(CONFIG_WMV3_DECODER)            += vc1.o
mru's avatar
mru committed
122 123 124 125 126
OBJS-$(CONFIG_WNV1_DECODER)            += wnv1.o
OBJS-$(CONFIG_WS_SND1_DECODER)         += ws-snd1.o
OBJS-$(CONFIG_XAN_WC3_DECODER)         += xan.o
OBJS-$(CONFIG_XAN_WC4_DECODER)         += xan.o
OBJS-$(CONFIG_XL_DECODER)              += xl.o
127 128
OBJS-$(CONFIG_ZLIB_DECODER)            += lcl.o
OBJS-$(CONFIG_ZLIB_ENCODER)            += lcl.o
mru's avatar
mru committed
129 130 131 132 133 134 135 136 137 138
OBJS-$(CONFIG_ZMBV_DECODER)            += zmbv.o

OBJS-$(CONFIG_FAAD)                    += faad.o
OBJS-$(CONFIG_FAAC)                    += faac.o
OBJS-$(CONFIG_XVID)                    += xvidff.o xvid_rc.o
OBJS-$(CONFIG_X264)                    += x264.o
OBJS-$(CONFIG_MP3LAME)                 += mp3lameaudio.o
OBJS-$(CONFIG_LIBVORBIS)               += oggvorbis.o
OBJS-$(CONFIG_LIBTHEORA)               += oggtheora.o
OBJS-$(CONFIG_LIBGSM)                  += libgsm.o
iive's avatar
iive committed
139

kabi's avatar
kabi committed
140
# currently using liba52 for ac3 decoding
mru's avatar
mru committed
141
OBJS-$(CONFIG_AC3)                     += a52dec.o
kabi's avatar
kabi committed
142 143

# using builtin liba52 or runtime linked liba52.so.0
mru's avatar
mru committed
144 145 146 147 148 149 150
OBJS-$(CONFIG_AC3)$(CONFIG_A52BIN)     += liba52/bit_allocate.o \
                                          liba52/bitstream.o    \
                                          liba52/downmix.o      \
                                          liba52/imdct.o        \
                                          liba52/parse.o        \
                                          liba52/crc.o          \
                                          liba52/resample.o
151

152
# currently using libdts for dts decoding
mru's avatar
mru committed
153 154
OBJS-$(CONFIG_DTS)                     += dtsdec.o
CFLAGS-$(CONFIG_DTS)                   += $(DTS_INC)
155

mru's avatar
mru committed
156 157 158 159 160
OBJS-$(AMR)                            += amr.o
OBJS-$(AMR_NB)                         += amr_float/sp_dec.o     \
                                          amr_float/sp_enc.o     \
                                          amr_float/interf_dec.o \
                                          amr_float/interf_enc.o
161

mru's avatar
mru committed
162 163 164
ifeq ($(AMR_NB_FIXED),yes)
EXTRAOBJS += amr/*.o
EXTRADEPS=amrlibs
michael's avatar
michael committed
165
endif
michaelni's avatar
 
michaelni committed
166

mru's avatar
mru committed
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
OBJS-$(AMR_WB)                        +=  amrwb_float/dec_acelp.o \
                                          amrwb_float/dec_dtx.o   \
                                          amrwb_float/dec_gain.o  \
                                          amrwb_float/dec_if.o    \
                                          amrwb_float/dec_lpc.o   \
                                          amrwb_float/dec_main.o  \
                                          amrwb_float/dec_rom.o   \
                                          amrwb_float/dec_util.o  \
                                          amrwb_float/enc_acelp.o \
                                          amrwb_float/enc_dtx.o   \
                                          amrwb_float/enc_gain.o  \
                                          amrwb_float/enc_if.o    \
                                          amrwb_float/enc_lpc.o   \
                                          amrwb_float/enc_main.o  \
                                          amrwb_float/enc_rom.o   \
                                          amrwb_float/enc_util.o  \
                                          amrwb_float/if_rom.o

OBJS-$(HAVE_PTHREADS)                  += pthread.o
OBJS-$(HAVE_W32THREADS)                += w32thread.o
OBJS-$(HAVE_OS2THREADS)                += os2thread.o
OBJS-$(HAVE_BEOSTHREADS)               += beosthread.o

OBJS-$(HAVE_XVMC_ACCEL)                += xvmcvideo.o
191

glantau's avatar
glantau committed
192
# i386 mmx specific stuff
193
ifeq ($(TARGET_MMX),yes)
glantau's avatar
glantau committed
194
OBJS += i386/fdct_mmx.o i386/cputest.o \
glantau's avatar
glantau committed
195
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
kabi's avatar
kabi committed
196
	i386/idct_mmx.o i386/motion_est_mmx.o \
197
	i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \
198
	i386/vp3dsp_sse2.o i386/fft_3dn.o i386/fft_3dn2.o i386/snowdsp_mmx.o
michael's avatar
michael committed
199 200 201
ifeq ($(CONFIG_GPL),yes)
OBJS += i386/idct_mmx_xvid.o
endif
mru's avatar
mru committed
202
ifeq ($(TARGET_BUILTIN_VECTOR),yes)
203
i386/fft_sse.o: CFLAGS+= -msse
kabi's avatar
kabi committed
204
depend: CFLAGS+= -msse
205
endif
mru's avatar
mru committed
206
ifeq ($(TARGET_BUILTIN_3DNOW),yes)
207
i386/fft_3dn.o: CFLAGS+= -m3dnow
208 209 210 211 212 213
ifeq ($(TARGET_ARCH_X86),yes)
i386/fft_3dn2.o: CFLAGS+= -march=athlon
endif
ifeq ($(TARGET_ARCH_X86_64),yes)
i386/fft_3dn2.o: CFLAGS+= -march=k8
endif
214
endif
glantau's avatar
glantau committed
215 216
endif

glantau's avatar
glantau committed
217
# armv4l specific stuff
mru's avatar
mru committed
218 219 220 221 222 223 224 225 226 227 228
ASM_OBJS-$(TARGET_ARCH_ARMV4L)         += armv4l/jrevdct_arm.o     \
                                          armv4l/simple_idct_arm.o \
                                          armv4l/dsputil_arm_s.o
OBJS-$(TARGET_ARCH_ARMV4L)             += armv4l/dsputil_arm.o   \
                                          armv4l/mpegvideo_arm.o
OBJS-$(TARGET_IWMMXT)                  += armv4l/dsputil_iwmmxt.o   \
                                          armv4l/mpegvideo_iwmmxt.o

# sun sparc
OBJS-$(TARGET_ARCH_SPARC)              += sparc/dsputil_vis.o
sparc/dsputil_vis.o: CFLAGS += -mcpu=ultrasparc -mtune=ultrasparc
glantau's avatar
glantau committed
229

glantau's avatar
glantau committed
230
# sun mediaLib specific stuff
mru's avatar
mru committed
231 232
OBJS-$(HAVE_MLIB)                      += mlib/dsputil_mlib.o
CFLAGS-$(HAVE_MLIB)                    += $(MLIB_INC)
233

234
# alpha specific stuff
mru's avatar
mru committed
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
OBJS-$(TARGET_ARCH_ALPHA)              += alpha/dsputil_alpha.o     \
                                          alpha/mpegvideo_alpha.o   \
                                          alpha/simple_idct_alpha.o \
                                          alpha/motion_est_alpha.o
ASM_OBJS-$(TARGET_ARCH_ALPHA)          += alpha/dsputil_alpha_asm.o  \
                                          alpha/motion_est_mvi_asm.o

OBJS-$(TARGET_ARCH_POWERPC)            += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
OBJS-$(TARGET_MMI)                     += ps2/dsputil_mmi.o   \
                                          ps2/idct_mmi.o      \
                                          ps2/mpegvideo_mmi.o
OBJS-$(TARGET_ARCH_SH4)                += sh4/idct_sh4.o      \
                                          sh4/dsputil_sh4.o   \
                                          sh4/dsputil_align.o
OBJS-$(TARGET_ALTIVEC)                 += ppc/dsputil_altivec.o      \
                                          ppc/mpegvideo_altivec.o    \
                                          ppc/idct_altivec.o         \
                                          ppc/fft_altivec.o          \
                                          ppc/gmc_altivec.o          \
                                          ppc/fdct_altivec.o         \
                                          ppc/dsputil_h264_altivec.o \
                                          ppc/dsputil_snow_altivec.o

CFLAGS += $(CFLAGS-yes)
OBJS += $(OBJS-yes)
ASM_OBJS += $(ASM_OBJS-yes)
261

mru's avatar
mru committed
262
EXTRALIBS := -L../libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)
263

264
NAME=avcodec
265
LIBAVUTIL= $(SRC_PATH)/libavutil/$(LIBPREF)avutil$(LIBSUF)
nickols_k's avatar
nickols_k committed
266
ifeq ($(BUILD_SHARED),yes)
267 268
LIBVERSION=$(LAVCVERSION)
LIBMAJOR=$(LAVCMAJOR)
nickols_k's avatar
nickols_k committed
269
endif
270
TESTS= imgresample-test dct-test motion-test fft-test
glantau's avatar
glantau committed
271

272 273
include $(SRC_PATH)/common.mak

kabi's avatar
kabi committed
274 275 276
amrlibs:
	$(MAKE) -C amr spclib fipoplib

nickols_k's avatar
nickols_k committed
277
tests: apiexample cpuid_test $(TESTS)
glantau's avatar
glantau committed
278 279 280

dsputil.o: dsputil.c dsputil.h

diego's avatar
diego committed
281
clean::
282
	rm -f \
283
	   i386/*.o i386/*~ \
glantau's avatar
glantau committed
284
	   armv4l/*.o armv4l/*~ \
glantau's avatar
glantau committed
285
	   mlib/*.o mlib/*~ \
286
	   alpha/*.o alpha/*~ \
287
	   ppc/*.o ppc/*~ \
288
	   ps2/*.o ps2/*~ \
289
	   sh4/*.o sh4/*~ \
290
	   sparc/*.o sparc/*~ \
kabi's avatar
kabi committed
291
	   liba52/*.o liba52/*~ \
diego's avatar
diego committed
292
	   amr_float/*.o \
kabi's avatar
kabi committed
293
	   apiexample $(TESTS)
294 295
	-$(MAKE) -C amr clean
	-$(MAKE) -C amrwb_float -f makefile.gcc clean
296

glantau's avatar
glantau committed
297 298
# api example program
apiexample: apiexample.c $(LIB)
299
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(LIBAVUTIL) $(EXTRALIBS)
glantau's avatar
glantau committed
300

nickols_k's avatar
nickols_k committed
301 302 303 304
# cpuid test
cpuid_test: i386/cputest.c
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<

glantau's avatar
glantau committed
305 306 307
# testing progs

imgresample-test: imgresample.c
michaelni's avatar
michaelni committed
308
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
glantau's avatar
glantau committed
309

bellard's avatar
bellard committed
310
dct-test: dct-test.o fdctref.o $(LIB)
michael's avatar
michael committed
311
	$(CC) -o $@ $^ -lm $(LIBAVUTIL)
312

glantau's avatar
glantau committed
313
motion-test: motion_test.o $(LIB)
michaelni's avatar
michaelni committed
314
	$(CC) -o $@ $^ -lm
glantau's avatar
glantau committed
315

316
fft-test: fft-test.o $(LIB)
317
	$(CC) -o $@ $^ $(LIBAVUTIL) -lm