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.

528 lines
12KB

  1. #
  2. # libavcodec Makefile
  3. # (c) 2000-2005 Fabrice Bellard
  4. #
  5. include ../config.mak
  6. VPATH=$(SRC_PATH)/libavcodec
  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)
  9. OBJS= bitstream.o utils.o mem.o allcodecs.o \
  10. mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
  11. mpegaudio.o ac3enc.o 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. 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_CINEPAK_DECODER),yes)
  29. OBJS+= cinepak.o
  30. endif
  31. ifeq ($(CONFIG_COOK_DECODER),yes)
  32. OBJS+= cook.o
  33. endif
  34. ifneq ($(CONFIG_CLJR_DECODER)$(CONFIG_CLJR_ENCODER),)
  35. OBJS+= cljr.o
  36. endif
  37. ifeq ($(CONFIG_CYUV_DECODER),yes)
  38. OBJS+= cyuv.o
  39. endif
  40. ifeq ($(CONFIG_DVBSUB_DECODER),yes)
  41. OBJS+= dvbsubdec.o
  42. endif
  43. ifeq ($(CONFIG_DVBSUB_ENCODER),yes)
  44. OBJS+= dvbsub.o
  45. endif
  46. ifeq ($(CONFIG_DVDSUB_DECODER),yes)
  47. OBJS+= dvdsub.o
  48. endif
  49. ifeq ($(CONFIG_DVDSUB_ENCODER),yes)
  50. OBJS+= dvdsubenc.o
  51. endif
  52. ifneq ($(CONFIG_DVVIDEO_DECODER)$(CONFIG_DVVIDEO_ENCODER),)
  53. OBJS+= dv.o
  54. endif
  55. ifeq ($(CONFIG_EIGHTBPS_DECODER),yes)
  56. OBJS+= 8bps.o
  57. endif
  58. ifneq ($(CONFIG_FFV1_DECODER)$(CONFIG_FFV1_ENCODER),)
  59. OBJS+= ffv1.o
  60. endif
  61. ifeq ($(CONFIG_FLAC_DECODER),yes)
  62. OBJS+= flac.o
  63. endif
  64. ifeq ($(CONFIG_FLIC_DECODER),yes)
  65. OBJS+= flicvideo.o
  66. endif
  67. ifeq ($(CONFIG_FOURXM_DECODER),yes)
  68. OBJS+= 4xm.o
  69. endif
  70. ifeq ($(CONFIG_FRAPS_DECODER),yes)
  71. OBJS+= fraps.o
  72. endif
  73. ifneq ($(CONFIG_H261_DECODER)$(CONFIG_H261_ENCODER),)
  74. OBJS+= h261.o
  75. endif
  76. ifneq ($(CONFIG_H264_DECODER)$(CONFIG_SVQ3_DECODER),)
  77. OBJS+= h264.o
  78. endif
  79. ifneq ($(CONFIG_HUFFYUV_DECODER)$(CONFIG_HUFFYUV_ENCODER)$(CONFIG_FFVHUFF_DECODER)$(CONFIG_FFVHUFF_ENCODER),)
  80. OBJS+= huffyuv.o
  81. endif
  82. ifeq ($(CONFIG_IDCIN_DECODER),yes)
  83. OBJS+= idcinvideo.o
  84. endif
  85. ifeq ($(CONFIG_INDEO2_DECODER),yes)
  86. OBJS+= indeo2.o
  87. endif
  88. ifeq ($(CONFIG_INDEO3_DECODER),yes)
  89. OBJS+= indeo3.o
  90. endif
  91. ifeq ($(CONFIG_INTERPLAY_VIDEO_DECODER),yes)
  92. OBJS+= interplayvideo.o
  93. endif
  94. ifneq ($(CONFIG_MSZH_DECODER)$(CONFIG_ZLIB_DECODER)$(CONFIG_ZLIB_ENCODER),)
  95. OBJS+= lcl.o
  96. endif
  97. ifeq ($(CONFIG_LOCO_DECODER),yes)
  98. OBJS+= loco.o
  99. endif
  100. ifneq ($(CONFIG_MACE3_DECODER)$(CONFIG_MACE6_DECODER),)
  101. OBJS+= mace.o
  102. endif
  103. ifeq ($(CONFIG_MSRLE_DECODER),yes)
  104. OBJS+= msrle.o
  105. endif
  106. ifeq ($(CONFIG_MSVIDEO1_DECODER),yes)
  107. OBJS+= msvideo1.o
  108. endif
  109. ifneq ($(CONFIG_PNG_DECODER)$(CONFIG_PNG_ENCODER),)
  110. OBJS+= png.o
  111. endif
  112. ifeq ($(CONFIG_QDM2_DECODER),yes)
  113. OBJS+= qdm2.o
  114. endif
  115. ifeq ($(CONFIG_QDRAW_DECODER),yes)
  116. OBJS+= qdrw.o
  117. endif
  118. ifeq ($(CONFIG_QPEG_DECODER),yes)
  119. OBJS+= qpeg.o
  120. endif
  121. ifeq ($(CONFIG_QTRLE_DECODER),yes)
  122. OBJS+= qtrle.o
  123. endif
  124. ifeq ($(CONFIG_RA_144_DECODER),yes)
  125. OBJS+= ra144.o
  126. endif
  127. ifeq ($(CONFIG_RA_288_DECODER),yes)
  128. OBJS+= ra288.o
  129. endif
  130. ifeq ($(CONFIG_ROQ_DECODER),yes)
  131. OBJS+= roqvideo.o
  132. endif
  133. ifeq ($(CONFIG_RPZA_DECODER),yes)
  134. OBJS+= rpza.o
  135. endif
  136. ifneq ($(CONFIG_RV10_DECODER)$(CONFIG_RV20_DECODER)$(CONFIG_RV10_ENCODER)$(CONFIG_RV20_ENCODER),)
  137. OBJS+= rv10.o
  138. endif
  139. ifeq ($(CONFIG_SHORTEN_DECODER),yes)
  140. OBJS+= shorten.o
  141. endif
  142. ifeq ($(CONFIG_SMC_DECODER),yes)
  143. OBJS+= smc.o
  144. endif
  145. ifneq ($(CONFIG_SNOW_DECODER)$(CONFIG_SNOW_ENCODER),)
  146. OBJS+= snow.o
  147. endif
  148. ifneq ($(CONFIG_SONIC_DECODER)$(CONFIG_SONIC_ENCODER)$(CONFIG_SONIC_LS_ENCODER),)
  149. OBJS+= sonic.o
  150. endif
  151. ifneq ($(CONFIG_SVQ1_DECODER)$(CONFIG_SVQ1_ENCODER),)
  152. OBJS+= svq1.o
  153. endif
  154. ifeq ($(CONFIG_TRUEMOTION1_DECODER),yes)
  155. OBJS+= truemotion1.o
  156. endif
  157. ifeq ($(CONFIG_TRUEMOTION2_DECODER),yes)
  158. OBJS+= truemotion2.o
  159. endif
  160. ifeq ($(CONFIG_TRUESPEECH_DECODER),yes)
  161. OBJS+= truespeech.o
  162. endif
  163. ifeq ($(CONFIG_TSCC_DECODER),yes)
  164. OBJS+= tscc.o
  165. endif
  166. ifeq ($(CONFIG_CSCD_DECODER),yes)
  167. OBJS+= cscd.o
  168. OBJS+= lzo.o
  169. endif
  170. ifeq ($(CONFIG_ULTI_DECODER),yes)
  171. OBJS+= ulti.o
  172. endif
  173. ifneq ($(CONFIG_VC9_DECODER)$(CONFIG_WMV3_DECODER),)
  174. OBJS+= vc9.o
  175. endif
  176. ifneq ($(CONFIG_VCR1_DECODER)$(CONFIG_VCR1_ENCODER),)
  177. OBJS+= vcr1.o
  178. endif
  179. ifneq ($(CONFIG_VMDVIDEO_DECODER)$(CONFIG_VMDAUDIO_DECODER),)
  180. OBJS+= vmdav.o
  181. endif
  182. ifeq ($(CONFIG_VORBIS_DECODER),yes)
  183. OBJS+= vorbis.o
  184. endif
  185. ifneq ($(CONFIG_VP3_DECODER)$(CONFIG_THEORA_DECODER),)
  186. OBJS+= vp3.o
  187. endif
  188. ifeq ($(CONFIG_VQA_DECODER),yes)
  189. OBJS+= vqavideo.o
  190. endif
  191. ifneq ($(CONFIG_WMAV1_DECODER)$(CONFIG_WMAV2_DECODER),)
  192. OBJS+= wmadec.o
  193. endif
  194. ifeq ($(CONFIG_WNV1_DECODER),yes)
  195. OBJS+= wnv1.o
  196. endif
  197. ifeq ($(CONFIG_WS_SND1_DECODER),yes)
  198. OBJS+= ws-snd1.o
  199. endif
  200. ifneq ($(CONFIG_XAN_WC3_DECODER)$(CONFIG_XAN_WC4_DECODER),)
  201. OBJS+= xan.o
  202. endif
  203. ifeq ($(CONFIG_XL_DECODER),yes)
  204. OBJS+= xl.o
  205. endif
  206. ifeq ($(CONFIG_BMP_DECODER),yes)
  207. OBJS+= bmp.o
  208. endif
  209. AMROBJS=
  210. ifeq ($(AMR_NB),yes)
  211. ifeq ($(AMR_NB_FIXED),yes)
  212. AMROBJS= amr.o
  213. AMREXTRALIBS+= amr/*.o
  214. AMRLIBS=amrlibs
  215. CLEANAMR=cleanamr
  216. else
  217. AMROBJS= amr.o
  218. OBJS+= amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
  219. CLEANAMR=cleanamrfloat
  220. endif
  221. endif
  222. ifeq ($(HAVE_PTHREADS),yes)
  223. OBJS+= pthread.o
  224. endif
  225. ifeq ($(HAVE_W32THREADS),yes)
  226. OBJS+= w32thread.o
  227. endif
  228. ifeq ($(HAVE_BEOSTHREADS),yes)
  229. OBJS+= beosthread.o
  230. endif
  231. ifeq ($(AMR_WB),yes)
  232. AMROBJS= amr.o
  233. OBJS+= amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o amrwb_float/dec_gain.o \
  234. amrwb_float/dec_if.o amrwb_float/dec_lpc.o amrwb_float/dec_main.o \
  235. amrwb_float/dec_rom.o amrwb_float/dec_util.o amrwb_float/enc_acelp.o \
  236. amrwb_float/enc_dtx.o amrwb_float/enc_gain.o amrwb_float/enc_if.o \
  237. amrwb_float/enc_lpc.o amrwb_float/enc_main.o amrwb_float/enc_rom.o \
  238. amrwb_float/enc_util.o amrwb_float/if_rom.o
  239. endif
  240. OBJS+= $(AMROBJS)
  241. CLEANAMRWB=cleanamrwbfloat
  242. ASM_OBJS=
  243. ifeq ($(HAVE_XVMC_ACCEL),yes)
  244. OBJS+= xvmcvideo.o
  245. endif
  246. # currently using liba52 for ac3 decoding
  247. ifeq ($(CONFIG_AC3),yes)
  248. OBJS+= a52dec.o
  249. # using builtin liba52 or runtime linked liba52.so.0
  250. ifneq ($(CONFIG_A52BIN),yes)
  251. OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
  252. liba52/imdct.o liba52/parse.o liba52/crc.o liba52/resample.o
  253. endif
  254. endif
  255. EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
  256. # currently using libdts for dts decoding
  257. ifeq ($(CONFIG_DTS),yes)
  258. OBJS+= dtsdec.o
  259. CFLAGS += $(DTS_INC)
  260. endif
  261. ifeq ($(CONFIG_FAAD),yes)
  262. OBJS+= faad.o
  263. endif
  264. ifeq ($(CONFIG_FAAC),yes)
  265. OBJS+= faac.o
  266. endif
  267. ifeq ($(CONFIG_XVID),yes)
  268. OBJS+= xvidff.o
  269. endif
  270. ifeq ($(CONFIG_X264),yes)
  271. OBJS+= x264.o
  272. endif
  273. ifeq ($(CONFIG_PP),yes)
  274. ifeq ($(SHARED_PP),yes)
  275. EXTRALIBS += -Llibpostproc -lpostproc$(BUILDSUF)
  276. else
  277. # LIBS += libpostproc/libpostproc.a ... should be fixed
  278. OBJS += libpostproc/postprocess.o
  279. endif
  280. endif
  281. ifeq ($(CONFIG_MP3LAME),yes)
  282. OBJS += mp3lameaudio.o
  283. endif
  284. ifeq ($(CONFIG_LIBOGG),yes)
  285. ifeq ($(CONFIG_LIBVORBIS),yes)
  286. OBJS += oggvorbis.o
  287. endif
  288. ifeq ($(CONFIG_LIBTHEORA), yes)
  289. OBJS += oggtheora.o
  290. endif
  291. endif
  292. ifeq ($(CONFIG_LIBGSM),yes)
  293. OBJS += libgsm.o
  294. endif
  295. ifeq ($(TARGET_GPROF),yes)
  296. CFLAGS+=-p
  297. LDFLAGS+=-p
  298. endif
  299. # i386 mmx specific stuff
  300. ifeq ($(TARGET_MMX),yes)
  301. OBJS += i386/fdct_mmx.o i386/cputest.o \
  302. i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
  303. i386/idct_mmx.o i386/motion_est_mmx.o \
  304. i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \
  305. i386/vp3dsp_sse2.o
  306. ifeq ($(CONFIG_GPL),yes)
  307. OBJS += i386/idct_mmx_xvid.o
  308. endif
  309. ifdef TARGET_BUILTIN_VECTOR
  310. i386/fft_sse.o: CFLAGS+= -msse
  311. depend: CFLAGS+= -msse
  312. endif
  313. endif
  314. # armv4l specific stuff
  315. ifeq ($(TARGET_ARCH_ARMV4L),yes)
  316. ASM_OBJS += armv4l/jrevdct_arm.o armv4l/simple_idct_arm.o armv4l/dsputil_arm_s.o
  317. OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
  318. ifeq ($(TARGET_IWMMXT),yes)
  319. OBJS += armv4l/dsputil_iwmmxt.o armv4l/mpegvideo_iwmmxt.o
  320. endif
  321. endif
  322. # sun mediaLib specific stuff
  323. # currently only works when libavcodec is used in mplayer
  324. ifeq ($(HAVE_MLIB),yes)
  325. OBJS += mlib/dsputil_mlib.o
  326. CFLAGS += $(MLIB_INC)
  327. endif
  328. # Intel IPP specific stuff
  329. # currently only works when libavcodec is used in mplayer
  330. ifeq ($(HAVE_IPP),yes)
  331. CFLAGS += $(IPP_INC)
  332. endif
  333. # alpha specific stuff
  334. ifeq ($(TARGET_ARCH_ALPHA),yes)
  335. OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
  336. alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
  337. ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
  338. CFLAGS += -fforce-addr
  339. endif
  340. ifeq ($(TARGET_ARCH_POWERPC),yes)
  341. OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
  342. endif
  343. ifeq ($(TARGET_MMI),yes)
  344. OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
  345. endif
  346. ifeq ($(TARGET_ALTIVEC),yes)
  347. OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
  348. ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o \
  349. ppc/dsputil_h264_altivec.o
  350. endif
  351. ifeq ($(TARGET_ARCH_SH4),yes)
  352. OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
  353. endif
  354. ifeq ($(TARGET_ARCH_SPARC),yes)
  355. OBJS+=sparc/dsputil_vis.o
  356. sparc/%.o: sparc/%.c
  357. $(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $<
  358. endif
  359. ifeq ($(TARGET_ARCH_SPARC64),yes)
  360. CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
  361. endif
  362. SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
  363. OBJS := $(OBJS) $(ASM_OBJS)
  364. LIB= $(LIBPREF)avcodec$(LIBSUF)
  365. LIBAVUTIL= $(SRC_PATH)/libavutil/$(LIBPREF)avutil$(LIBSUF)
  366. ifeq ($(BUILD_SHARED),yes)
  367. SLIBNAME= $(SLIBPREF)avcodec$(SLIBSUF)
  368. endif
  369. TESTS= imgresample-test dct-test motion-test fft-test
  370. all: $(LIB) $(SLIBNAME)
  371. amrlibs:
  372. $(MAKE) -C amr spclib fipoplib
  373. tests: apiexample cpuid_test $(TESTS)
  374. $(LIB): $(OBJS) $(AMRLIBS)
  375. rm -f $@
  376. $(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
  377. $(RANLIB) $@
  378. $(SLIBNAME): $(OBJS)
  379. ifeq ($(CONFIG_PP),yes)
  380. $(MAKE) -C libpostproc
  381. endif
  382. ifeq ($(CONFIG_WIN32),yes)
  383. $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
  384. -lib /machine:i386 /def:$(@:.dll=.def)
  385. else
  386. $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
  387. endif
  388. dsputil.o: dsputil.c dsputil.h
  389. libpostproc/libpostproc.a:
  390. $(MAKE) -C libpostproc
  391. %.o: %.c
  392. $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
  393. %.o: %.S
  394. $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
  395. depend: $(SRCS)
  396. $(CC) -MM $(CFLAGS) $^ 1>.depend
  397. dep: depend
  398. clean: $(CLEANAMR)
  399. rm -f *.o *.d *~ .depend $(LIB) $(SLIBNAME) *$(SLIBSUF) i386/*.o i386/*~ \
  400. armv4l/*.o armv4l/*~ \
  401. mlib/*.o mlib/*~ \
  402. alpha/*.o alpha/*~ \
  403. ppc/*.o ppc/*~ \
  404. ps2/*.o ps2/*~ \
  405. sh4/*.o sh4/*~ \
  406. sparc/*.o sparc/*~ \
  407. liba52/*.o liba52/*~ \
  408. apiexample $(TESTS)
  409. $(MAKE) -C libpostproc clean
  410. distclean: clean
  411. rm -f Makefile.bak .depend
  412. cleanamr:
  413. $(MAKE) -C amr clean
  414. cleanamrfloat:
  415. rm -f amr_float/*.o
  416. cleanamrwbfloat:
  417. $(MAKE) -C amrwb_float -f makefile.gcc clean
  418. # api example program
  419. apiexample: apiexample.c $(LIB)
  420. $(CC) $(CFLAGS) -o $@ $< $(LIB) $(LIBAVUTIL) $(EXTRALIBS) -lm
  421. # cpuid test
  422. cpuid_test: i386/cputest.c
  423. $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
  424. # testing progs
  425. imgresample-test: imgresample.c
  426. $(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
  427. dct-test: dct-test.o fdctref.o $(LIB)
  428. $(CC) -o $@ $^ -lm $(LIBAVUTIL)
  429. motion-test: motion_test.o $(LIB)
  430. $(CC) -o $@ $^ -lm
  431. fft-test: fft-test.o $(LIB)
  432. $(CC) -o $@ $^ $(LIBAVUTIL) -lm
  433. ifeq ($(BUILD_SHARED),yes)
  434. LIBVERSION=$(LAVCMAJOR)
  435. install: all install-headers
  436. ifeq ($(CONFIG_WIN32),yes)
  437. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
  438. else
  439. install -d $(libdir)
  440. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/libavcodec-$(VERSION)$(SLIBSUF)
  441. ln -sf libavcodec-$(VERSION)$(SLIBSUF) $(libdir)/libavcodec$(SLIBSUF)
  442. $(LDCONFIG) || true
  443. endif
  444. ifeq ($(CONFIG_PP),yes)
  445. $(MAKE) -C libpostproc $@
  446. endif
  447. else
  448. install:
  449. endif
  450. installlib: all install-headers
  451. install -m 644 $(LIB) "$(libdir)"
  452. install-headers:
  453. mkdir -p "$(prefix)/include/ffmpeg"
  454. install -m 644 $(SRC_PATH)/libavcodec/avcodec.h \
  455. "$(prefix)/include/ffmpeg"
  456. install -m 644 $(SRC_PATH)/libavcodec/dsputil.h \
  457. "$(prefix)/include/ffmpeg"
  458. install -d "$(libdir)/pkgconfig"
  459. install -m 644 ../libavcodec.pc "$(libdir)/pkgconfig"
  460. #
  461. # include dependency files if they exist
  462. #
  463. ifneq ($(wildcard .depend),)
  464. include .depend
  465. endif