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.

482 lines
11KB

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