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.

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