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.

174 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. OBJS += ppc/dsputil_ppc.o
  64. endif
  65. ifeq ($(TARGET_ALTIVEC),yes)
  66. CFLAGS += -faltivec
  67. OBJS += ppc/dsputil_altivec.o
  68. endif
  69. SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
  70. OBJS := $(OBJS) $(ASM_OBJS)
  71. LIB= libavcodec.a
  72. ifeq ($(BUILD_SHARED),yes)
  73. SLIB= libavcodec.so
  74. endif
  75. TESTS= imgresample-test dct-test motion-test
  76. all: $(LIB) $(SLIB)
  77. tests: apiexample cpuid_test $(TESTS)
  78. $(LIB): $(OBJS)
  79. rm -f $@
  80. $(AR) rc $@ $(OBJS)
  81. $(RANLIB) $@
  82. $(SLIB): $(OBJS)
  83. $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
  84. dsputil.o: dsputil.c dsputil.h
  85. %.o: %.c
  86. $(CC) $(CFLAGS) -c -o $@ $<
  87. %.o: %.S
  88. $(CC) $(CFLAGS) -c -o $@ $<
  89. # depend only used by mplayer now
  90. dep: depend
  91. depend:
  92. $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
  93. clean:
  94. rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
  95. armv4l/*.o armv4l/*~ \
  96. mlib/*.o mlib/*~ \
  97. alpha/*.o alpha/*~ \
  98. ppc/*.o ppc/*~ \
  99. liba52/*.o liba52/*~ \
  100. apiexample $(TESTS)
  101. distclean: clean
  102. rm -f Makefile.bak .depend
  103. # api example program
  104. apiexample: apiexample.c $(LIB)
  105. $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
  106. # cpuid test
  107. cpuid_test: i386/cputest.c
  108. $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
  109. # testing progs
  110. imgresample-test: imgresample.c
  111. $(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
  112. dct-test: dct-test.o jfdctfst.o jfdctint.o i386/fdct_mmx.o\
  113. fdctref.o jrevdct.o i386/idct_mmx.o simple_idct.o i386/simple_idct_mmx.o
  114. $(CC) -o $@ $^ -lm
  115. motion-test: motion_test.o $(LIB)
  116. $(CC) -o $@ $^ -lm
  117. install: all
  118. ifeq ($(BUILD_SHARED),yes)
  119. install -d $(prefix)/lib
  120. install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
  121. ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
  122. ldconfig || true
  123. mkdir -p $(prefix)/include/ffmpeg
  124. install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
  125. install -m 644 common.h $(prefix)/include/ffmpeg/common.h
  126. endif
  127. installlib: all
  128. install -m 644 $(LIB) $(prefix)/lib
  129. mkdir -p $(prefix)/include/ffmpeg
  130. install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
  131. $(prefix)/include/ffmpeg
  132. #
  133. # include dependency files if they exist
  134. #
  135. ifneq ($(wildcard .depend),)
  136. include .depend
  137. endif