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.

169 lines
3.9KB

  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.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
  9. LDFLAGS= -g
  10. OBJS= common.o utils.o mem.o allcodecs.o \
  11. mpegvideo.o h263.o jrevdct.o jfdctfst.o jfdctint.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 svq1.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
  15. ratecontrol.o adpcm.o eval.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 ($(CONFIG_VORBIS),yes)
  31. OBJS += oggvorbis.o
  32. EXTRALIBS += -lvorbis -lvorbisenc
  33. endif
  34. ifeq ($(TARGET_GPROF),yes)
  35. CFLAGS+=-p
  36. LDFLAGS+=-p
  37. endif
  38. # i386 mmx specific stuff
  39. ifeq ($(TARGET_MMX),yes)
  40. OBJS += i386/fdct_mmx.o i386/cputest.o \
  41. i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
  42. i386/idct_mmx.o i386/motion_est_mmx.o \
  43. i386/simple_idct_mmx.o
  44. endif
  45. # armv4l specific stuff
  46. ifeq ($(TARGET_ARCH_ARMV4L),yes)
  47. ASM_OBJS += armv4l/jrevdct_arm.o
  48. OBJS += armv4l/dsputil_arm.o
  49. endif
  50. # sun mediaLib specific stuff
  51. # currently only works when libavcodec is used in mplayer
  52. ifeq ($(HAVE_MLIB),yes)
  53. OBJS += mlib/dsputil_mlib.o
  54. CFLAGS += $(MLIB_INC)
  55. endif
  56. # alpha specific stuff
  57. ifeq ($(TARGET_ARCH_ALPHA),yes)
  58. OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o alpha/motion_est_alpha.o
  59. ASM_OBJS += alpha/dsputil_alpha_asm.o
  60. CFLAGS += -Wa,-mpca56 -finline-limit=8000 -fforce-addr -freduce-all-givs
  61. endif
  62. ifeq ($(TARGET_ARCH_POWERPC),yes)
  63. CFLAGS += -faltivec
  64. OBJS += ppc/dsputil_altivec.o
  65. endif
  66. SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
  67. OBJS := $(OBJS) $(ASM_OBJS)
  68. LIB= libavcodec.a
  69. ifeq ($(BUILD_SHARED),yes)
  70. SLIB= libavcodec.so
  71. endif
  72. TESTS= imgresample-test dct-test motion-test
  73. all: $(LIB) $(SLIB)
  74. tests: apiexample cpuid_test $(TESTS)
  75. $(LIB): $(OBJS)
  76. rm -f $@
  77. $(AR) rcs $@ $(OBJS)
  78. $(SLIB): $(OBJS)
  79. $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
  80. dsputil.o: dsputil.c dsputil.h
  81. %.o: %.c
  82. $(CC) $(CFLAGS) -c -o $@ $<
  83. %.o: %.S
  84. $(CC) $(CFLAGS) -c -o $@ $<
  85. # depend only used by mplayer now
  86. dep: depend
  87. depend:
  88. $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
  89. clean:
  90. rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
  91. armv4l/*.o armv4l/*~ \
  92. mlib/*.o mlib/*~ \
  93. alpha/*.o alpha/*~ \
  94. ppc/*.o ppc/*~ \
  95. liba52/*.o liba52/*~ \
  96. apiexample $(TESTS)
  97. distclean: clean
  98. rm -f Makefile.bak .depend
  99. # api example program
  100. apiexample: apiexample.c $(LIB)
  101. $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
  102. # cpuid test
  103. cpuid_test: i386/cputest.c
  104. $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
  105. # testing progs
  106. imgresample-test: imgresample.c
  107. $(CC) $(CFLAGS) -DTEST -o $@ $^
  108. dct-test: dct-test.o jfdctfst.o jfdctint.o i386/fdct_mmx.o\
  109. fdctref.o jrevdct.o i386/idct_mmx.o simple_idct.o i386/simple_idct_mmx.o
  110. $(CC) -o $@ $^ -lm
  111. motion-test: motion_test.o $(LIB)
  112. $(CC) -o $@ $^
  113. install: all
  114. ifeq ($(BUILD_SHARED),yes)
  115. install -d $(prefix)/lib
  116. install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
  117. ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
  118. ldconfig || true
  119. mkdir -p $(prefix)/include/ffmpeg
  120. install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
  121. install -m 644 common.h $(prefix)/include/ffmpeg/common.h
  122. endif
  123. installlib: all
  124. install -m 644 $(LIB) $(prefix)/lib
  125. mkdir -p $(prefix)/include/ffmpeg
  126. install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
  127. $(prefix)/include/ffmpeg
  128. #
  129. # include dependency files if they exist
  130. #
  131. ifneq ($(wildcard .depend),)
  132. include .depend
  133. endif