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.

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