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.

140 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. endif
  22. ifeq ($(TARGET_GPROF),yes)
  23. CFLAGS+=-p
  24. LDFLAGS+=-p
  25. endif
  26. # i386 mmx specific stuff
  27. ifeq ($(TARGET_MMX),yes)
  28. OBJS += i386/fdct_mmx.o i386/cputest.o \
  29. i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
  30. i386/idct_mmx.o i386/motion_est_mmx.o \
  31. i386/simple_idct_mmx.o
  32. endif
  33. # armv4l specific stuff
  34. ifeq ($(TARGET_ARCH_ARMV4L),yes)
  35. ASM_OBJS += armv4l/jrevdct_arm.o
  36. OBJS += armv4l/dsputil_arm.o
  37. endif
  38. # sun mediaLib specific stuff
  39. # currently only works when libavcodec is used in mplayer
  40. ifeq ($(HAVE_MLIB),yes)
  41. OBJS += mlib/dsputil_mlib.o
  42. CFLAGS += $(MLIB_INC)
  43. endif
  44. # alpha specific stuff
  45. ifeq ($(TARGET_ARCH_ALPHA),yes)
  46. OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
  47. CFLAGS += -Wa,-mpca56
  48. endif
  49. SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
  50. LIB= libavcodec.a
  51. ifeq ($(BUILD_SHARED),yes)
  52. SLIB= libffmpeg-$(VERSION).so
  53. endif
  54. TESTS= imgresample-test dct-test motion-test
  55. all: $(LIB) $(SLIB)
  56. tests: apiexample cpuid_test $(TESTS)
  57. $(LIB): $(OBJS) $(ASM_OBJS)
  58. rm -f $@
  59. $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
  60. $(SLIB): $(OBJS) $(ASM_OBJS)
  61. rm -f $@
  62. $(CC) -shared -o $@ $(OBJS) $(ASM_OBJS)
  63. ln -sf $@ libffmpeg.so
  64. dsputil.o: dsputil.c dsputil.h
  65. %.o: %.c
  66. $(CC) $(CFLAGS) -c -o $@ $<
  67. %.o: %.S
  68. $(CC) $(CFLAGS) -c -o $@ $<
  69. # depend only used by mplayer now
  70. dep: depend
  71. depend:
  72. $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
  73. clean:
  74. rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
  75. armv4l/*.o armv4l/*~ \
  76. mlib/*.o mlib/*~ \
  77. alpha/*.o alpha/*~ \
  78. liba52/*.o liba52/*~ \
  79. apiexample $(TESTS)
  80. distclean: clean
  81. rm -f Makefile.bak .depend
  82. # api example program
  83. apiexample: apiexample.c $(LIB)
  84. $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
  85. # cpuid test
  86. cpuid_test: i386/cputest.c
  87. $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
  88. # testing progs
  89. imgresample-test: imgresample.c
  90. $(CC) $(CFLAGS) -DTEST -o $@ $^
  91. dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
  92. fdctref.o jrevdct.o i386/idct_mmx.o
  93. $(CC) -o $@ $^
  94. motion-test: motion_test.o $(LIB)
  95. $(CC) -o $@ $^
  96. install: all
  97. # install -m 644 $(LIB) $(prefix)/lib
  98. ifeq ($(BUILD_SHARED),yes)
  99. install -s -m 755 $(SLIB) $(prefix)/lib
  100. ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
  101. ldconfig
  102. mkdir -p $(prefix)/include/libffmpeg
  103. install -m 644 avcodec.h $(prefix)/include/libffmpeg/avcodec.h
  104. install -m 644 common.h $(prefix)/include/libffmpeg/common.h
  105. endif
  106. #
  107. # include dependency files if they exist
  108. #
  109. ifneq ($(wildcard .depend),)
  110. include .depend
  111. endif