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.

157 lines
3.4KB

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