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.

147 lines
3.2KB

  1. #
  2. # libavcodec Makefile
  3. # (c) 2000, 2001, 2002 Gerard Lantau
  4. #
  5. include ../config.mak
  6. VPATH=$(SRC_PATH)/libavcodec
  7. CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)
  8. LDFLAGS= -g
  9. OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
  10. mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
  11. motion_est.o imgconvert.o imgresample.o msmpeg4.o \
  12. mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
  13. ratecontrol.o
  14. ASM_OBJS=
  15. # currently using liba52 for ac3 decoding
  16. ifeq ($(CONFIG_AC3),yes)
  17. OBJS+= a52dec.o
  18. endif
  19. # using builtin liba52 or runtime linked liba52.so.0
  20. ifeq ($(CONFIG_A52BIN),no)
  21. OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
  22. liba52/imdct.o liba52/parse.o
  23. endif
  24. ifeq ($(CONFIG_MP3LAME),yes)
  25. OBJS += mp3lameaudio.o
  26. EXTRALIBS += -lmp3lame
  27. endif
  28. ifeq ($(TARGET_GPROF),yes)
  29. CFLAGS+=-p
  30. LDFLAGS+=-p
  31. endif
  32. # i386 mmx specific stuff
  33. ifeq ($(TARGET_MMX),yes)
  34. OBJS += i386/fdct_mmx.o i386/cputest.o \
  35. i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
  36. i386/idct_mmx.o i386/motion_est_mmx.o \
  37. i386/simple_idct_mmx.o
  38. endif
  39. # armv4l specific stuff
  40. ifeq ($(TARGET_ARCH_ARMV4L),yes)
  41. ASM_OBJS += armv4l/jrevdct_arm.o
  42. OBJS += armv4l/dsputil_arm.o
  43. endif
  44. # sun mediaLib specific stuff
  45. # currently only works when libavcodec is used in mplayer
  46. ifeq ($(HAVE_MLIB),yes)
  47. OBJS += mlib/dsputil_mlib.o
  48. CFLAGS += $(MLIB_INC)
  49. endif
  50. # alpha specific stuff
  51. ifeq ($(TARGET_ARCH_ALPHA),yes)
  52. OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
  53. CFLAGS += -Wa,-mpca56
  54. endif
  55. SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
  56. LIB= libavcodec.a
  57. ifeq ($(BUILD_SHARED),yes)
  58. SLIB= libffmpeg-$(VERSION).so
  59. endif
  60. TESTS= imgresample-test dct-test motion-test
  61. all: $(LIB) $(SLIB)
  62. tests: apiexample cpuid_test $(TESTS)
  63. $(LIB): $(OBJS) $(ASM_OBJS)
  64. rm -f $@
  65. $(AR) rc $@ $(OBJS) $(ASM_OBJS)
  66. $(SLIB): $(OBJS) $(ASM_OBJS)
  67. rm -f $@
  68. $(CC) -shared -o $@ $(OBJS) $(ASM_OBJS) $(EXTRALIBS)
  69. ln -sf $@ libffmpeg.so
  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
  106. ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
  107. ldconfig
  108. mkdir -p $(prefix)/include/libffmpeg
  109. install -m 644 avcodec.h $(prefix)/include/libffmpeg/avcodec.h
  110. install -m 644 common.h $(prefix)/include/libffmpeg/common.h
  111. endif
  112. #
  113. # include dependency files if they exist
  114. #
  115. ifneq ($(wildcard .depend),)
  116. include .depend
  117. endif