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.

156 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. CFLAGS += -Wa,-mpca56
  56. endif
  57. SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
  58. OBJS := $(OBJS) $(ASM_OBJS)
  59. LIB= libavcodec.a
  60. ifeq ($(BUILD_SHARED),yes)
  61. SLIB= libavcodec.so
  62. endif
  63. TESTS= imgresample-test dct-test motion-test
  64. all: $(LIB) $(SLIB)
  65. tests: apiexample cpuid_test $(TESTS)
  66. $(LIB): $(OBJS)
  67. rm -f $@
  68. $(AR) rc $@ $(OBJS)
  69. $(SLIB): $(OBJS)
  70. $(CC) -shared -o $@ $(OBJS) $(EXTRALIBS)
  71. dsputil.o: dsputil.c dsputil.h
  72. %.o: %.c
  73. $(CC) $(CFLAGS) -c -o $@ $<
  74. %.o: %.S
  75. $(CC) $(CFLAGS) -c -o $@ $<
  76. # depend only used by mplayer now
  77. dep: depend
  78. depend:
  79. $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
  80. clean:
  81. rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
  82. armv4l/*.o armv4l/*~ \
  83. mlib/*.o mlib/*~ \
  84. alpha/*.o alpha/*~ \
  85. liba52/*.o liba52/*~ \
  86. apiexample $(TESTS)
  87. distclean: clean
  88. rm -f Makefile.bak .depend
  89. # api example program
  90. apiexample: apiexample.c $(LIB)
  91. $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
  92. # cpuid test
  93. cpuid_test: i386/cputest.c
  94. $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
  95. # testing progs
  96. imgresample-test: imgresample.c
  97. $(CC) $(CFLAGS) -DTEST -o $@ $^
  98. dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
  99. fdctref.o jrevdct.o i386/idct_mmx.o
  100. $(CC) -o $@ $^
  101. motion-test: motion_test.o $(LIB)
  102. $(CC) -o $@ $^
  103. install: all
  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. installlib: all
  113. install -m 644 $(LIB) $(prefix)/lib
  114. mkdir -p $(prefix)/include/ffmpeg
  115. install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
  116. $(prefix)/include/ffmpeg
  117. #
  118. # include dependency files if they exist
  119. #
  120. ifneq ($(wildcard .depend),)
  121. include .depend
  122. endif