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.

126 lines
2.8KB

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