You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

479 lines
11KB

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