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.

141 lines
3.1KB

  1. include ../config.mak
  2. CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I. -I..
  3. LDFLAGS= -g
  4. OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
  5. mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
  6. motion_est.o imgconvert.o imgresample.o msmpeg4.o \
  7. mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
  8. ratecontrol.o
  9. ASM_OBJS=
  10. # currently using liba52 for ac3 decoding
  11. ifeq ($(CONFIG_AC3),yes)
  12. OBJS+= a52dec.o
  13. endif
  14. # using builtin liba52 or runtime linked liba52.so.0
  15. ifeq ($(CONFIG_A52BIN),no)
  16. OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
  17. liba52/imdct.o liba52/parse.o
  18. endif
  19. ifeq ($(CONFIG_MP3LAME),yes)
  20. OBJS += mp3lameaudio.o
  21. EXTRALIBS += -lmp3lame
  22. endif
  23. ifeq ($(TARGET_GPROF),yes)
  24. CFLAGS+=-p
  25. LDFLAGS+=-p
  26. endif
  27. # i386 mmx specific stuff
  28. ifeq ($(TARGET_MMX),yes)
  29. OBJS += i386/fdct_mmx.o i386/cputest.o \
  30. i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
  31. i386/idct_mmx.o i386/motion_est_mmx.o \
  32. i386/simple_idct_mmx.o
  33. endif
  34. # armv4l specific stuff
  35. ifeq ($(TARGET_ARCH_ARMV4L),yes)
  36. ASM_OBJS += armv4l/jrevdct_arm.o
  37. OBJS += armv4l/dsputil_arm.o
  38. endif
  39. # sun mediaLib specific stuff
  40. # currently only works when libavcodec is used in mplayer
  41. ifeq ($(HAVE_MLIB),yes)
  42. OBJS += mlib/dsputil_mlib.o
  43. CFLAGS += $(MLIB_INC)
  44. endif
  45. # alpha specific stuff
  46. ifeq ($(TARGET_ARCH_ALPHA),yes)
  47. OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
  48. CFLAGS += -Wa,-mpca56
  49. endif
  50. SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
  51. LIB= libavcodec.a
  52. ifeq ($(BUILD_SHARED),yes)
  53. SLIB= libffmpeg-$(VERSION).so
  54. endif
  55. TESTS= imgresample-test dct-test motion-test
  56. all: $(LIB) $(SLIB)
  57. tests: apiexample cpuid_test $(TESTS)
  58. $(LIB): $(OBJS) $(ASM_OBJS)
  59. rm -f $@
  60. $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
  61. $(SLIB): $(OBJS) $(ASM_OBJS)
  62. rm -f $@
  63. $(CC) -shared -o $@ $(OBJS) $(ASM_OBJS) $(EXTRALIBS)
  64. ln -sf $@ libffmpeg.so
  65. dsputil.o: dsputil.c dsputil.h
  66. %.o: %.c
  67. $(CC) $(CFLAGS) -c -o $@ $<
  68. %.o: %.S
  69. $(CC) $(CFLAGS) -c -o $@ $<
  70. # depend only used by mplayer now
  71. dep: depend
  72. depend:
  73. $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
  74. clean:
  75. rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
  76. armv4l/*.o armv4l/*~ \
  77. mlib/*.o mlib/*~ \
  78. alpha/*.o alpha/*~ \
  79. liba52/*.o liba52/*~ \
  80. apiexample $(TESTS)
  81. distclean: clean
  82. rm -f Makefile.bak .depend
  83. # api example program
  84. apiexample: apiexample.c $(LIB)
  85. $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
  86. # cpuid test
  87. cpuid_test: i386/cputest.c
  88. $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
  89. # testing progs
  90. imgresample-test: imgresample.c
  91. $(CC) $(CFLAGS) -DTEST -o $@ $^
  92. dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
  93. fdctref.o jrevdct.o i386/idct_mmx.o
  94. $(CC) -o $@ $^
  95. motion-test: motion_test.o $(LIB)
  96. $(CC) -o $@ $^
  97. install: all
  98. # install -m 644 $(LIB) $(prefix)/lib
  99. ifeq ($(BUILD_SHARED),yes)
  100. install -s -m 755 $(SLIB) $(prefix)/lib
  101. ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
  102. ldconfig
  103. mkdir -p $(prefix)/include/libffmpeg
  104. install -m 644 avcodec.h $(prefix)/include/libffmpeg/avcodec.h
  105. install -m 644 common.h $(prefix)/include/libffmpeg/common.h
  106. endif
  107. #
  108. # include dependency files if they exist
  109. #
  110. ifneq ($(wildcard .depend),)
  111. include .depend
  112. endif