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.

149 lines
3.2KB

  1. #
  2. # libavcodec Makefile
  3. # (c) 2000, 2001, 2002 Fabrice Bellard
  4. #
  5. include ../config.mak
  6. VPATH=$(SRC_PATH)/libavcodec
  7. # NOTE: -I.. is needed to include config.h
  8. CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I..
  9. LDFLAGS= -g
  10. OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
  11. mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
  12. motion_est.o imgconvert.o imgresample.o msmpeg4.o \
  13. mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
  14. ratecontrol.o
  15. ASM_OBJS=
  16. # currently using liba52 for ac3 decoding
  17. ifeq ($(CONFIG_AC3),yes)
  18. OBJS+= a52dec.o
  19. # using builtin liba52 or runtime linked liba52.so.0
  20. ifneq ($(CONFIG_A52BIN),yes)
  21. OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
  22. liba52/imdct.o liba52/parse.o
  23. endif
  24. endif
  25. ifeq ($(CONFIG_MP3LAME),yes)
  26. OBJS += mp3lameaudio.o
  27. EXTRALIBS += -lmp3lame
  28. endif
  29. ifeq ($(TARGET_GPROF),yes)
  30. CFLAGS+=-p
  31. LDFLAGS+=-p
  32. endif
  33. # i386 mmx specific stuff
  34. ifeq ($(TARGET_MMX),yes)
  35. OBJS += i386/fdct_mmx.o i386/cputest.o \
  36. i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
  37. i386/idct_mmx.o i386/motion_est_mmx.o \
  38. i386/simple_idct_mmx.o
  39. endif
  40. # armv4l specific stuff
  41. ifeq ($(TARGET_ARCH_ARMV4L),yes)
  42. ASM_OBJS += armv4l/jrevdct_arm.o
  43. OBJS += armv4l/dsputil_arm.o
  44. endif
  45. # sun mediaLib specific stuff
  46. # currently only works when libavcodec is used in mplayer
  47. ifeq ($(HAVE_MLIB),yes)
  48. OBJS += mlib/dsputil_mlib.o
  49. CFLAGS += $(MLIB_INC)
  50. endif
  51. # alpha specific stuff
  52. ifeq ($(TARGET_ARCH_ALPHA),yes)
  53. OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
  54. CFLAGS += -Wa,-mpca56
  55. endif
  56. SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
  57. OBJS := $(OBJS) $(ASM_OBJS)
  58. LIB= libavcodec.a
  59. ifeq ($(BUILD_SHARED),yes)
  60. SLIB= libavcodec.so
  61. endif
  62. TESTS= imgresample-test dct-test motion-test
  63. all: $(LIB) $(SLIB)
  64. tests: apiexample cpuid_test $(TESTS)
  65. $(LIB): $(OBJS)
  66. rm -f $@
  67. $(AR) rc $@ $(OBJS)
  68. $(SLIB): $(OBJS)
  69. $(CC) -shared -o $@ $(OBJS) $(EXTRALIBS)
  70. dsputil.o: dsputil.c dsputil.h
  71. %.o: %.c
  72. $(CC) $(CFLAGS) -c -o $@ $<
  73. %.o: %.S
  74. $(CC) $(CFLAGS) -c -o $@ $<
  75. # depend only used by mplayer now
  76. dep: depend
  77. depend:
  78. $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
  79. clean:
  80. rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
  81. armv4l/*.o armv4l/*~ \
  82. mlib/*.o mlib/*~ \
  83. alpha/*.o alpha/*~ \
  84. liba52/*.o liba52/*~ \
  85. apiexample $(TESTS)
  86. distclean: clean�
  87. rm -f Makefile.bak .depend
  88. # api example program
  89. apiexample: apiexample.c $(LIB)
  90. $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
  91. # cpuid test
  92. cpuid_test: i386/cputest.c
  93. $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
  94. # testing progs
  95. imgresample-test: imgresample.c
  96. $(CC) $(CFLAGS) -DTEST -o $@ $^
  97. dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
  98. fdctref.o jrevdct.o i386/idct_mmx.o
  99. $(CC) -o $@ $^
  100. motion-test: motion_test.o $(LIB)
  101. $(CC) -o $@ $^
  102. install: all
  103. # install -m 644 $(LIB) $(prefix)/lib
  104. ifeq ($(BUILD_SHARED),yes)
  105. install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
  106. ln -sf $(prefix)/lib/libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
  107. ldconfig
  108. mkdir -p $(prefix)/include/ffmpeg
  109. install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
  110. install -m 644 common.h $(prefix)/include/ffmpeg/common.h
  111. endif
  112. #
  113. # include dependency files if they exist
  114. #
  115. ifneq ($(wildcard .depend),)
  116. include .depend
  117. endif