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.

136 lines
3.0KB

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