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.

118 lines
2.6KB

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