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.

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