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.8KB

  1. #
  2. # libavformat Makefile
  3. # (c) 2000-2003 Fabrice Bellard
  4. #
  5. include ../config.mak
  6. VPATH=$(SRC_PATH)/libavformat
  7. CFLAGS=$(OPTFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavutil -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
  8. OBJS= utils.o cutils.o os_support.o allformats.o
  9. PPOBJS=
  10. # mux and demuxes
  11. OBJS+=mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.o img2.o raw.o rm.o \
  12. avienc.o avidec.o wav.o mmf.o swf.o au.o gif.o mov.o mpjpeg.o dv.o \
  13. yuv4mpeg.o 4xm.o flvenc.o flvdec.o movenc.o psxstr.o idroq.o ipmovie.o \
  14. nut.o wc3movie.o mp3.o westwood.o segafilm.o idcin.o flic.o \
  15. sierravmd.o matroska.o sol.o electronicarts.o nsvdec.o asf.o asf-enc.o \
  16. ogg2.o oggparsevorbis.o oggparsetheora.o oggparseflac.o daud.o
  17. AMROBJS=
  18. ifeq ($(AMR_NB),yes)
  19. AMROBJS= amr.o
  20. endif
  21. ifeq ($(AMR_NB_FIXED),yes)
  22. AMROBJS= amr.o
  23. endif
  24. ifeq ($(AMR_WB),yes)
  25. AMROBJS= amr.o
  26. endif
  27. OBJS+= $(AMROBJS)
  28. # image formats
  29. OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o
  30. # file I/O
  31. OBJS+= avio.o aviobuf.o file.o
  32. OBJS+= framehook.o
  33. ifeq ($(CONFIG_VIDEO4LINUX),yes)
  34. OBJS+= grab.o
  35. endif
  36. ifeq ($(CONFIG_BKTR),yes)
  37. OBJS+= grab_bktr.o
  38. endif
  39. ifeq ($(CONFIG_DV1394),yes)
  40. OBJS+= dv1394.o
  41. endif
  42. ifeq ($(CONFIG_DC1394),yes)
  43. OBJS+= dc1394.o
  44. endif
  45. ifeq ($(CONFIG_AUDIO_OSS),yes)
  46. OBJS+= audio.o
  47. endif
  48. EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
  49. ifeq ($(CONFIG_AUDIO_BEOS),yes)
  50. PPOBJS+= beosaudio.o
  51. EXTRALIBS+=-lbe -lmedia
  52. endif
  53. ifeq ($(CONFIG_NETWORK),yes)
  54. OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
  55. # BeOS and Darwin network stuff
  56. ifeq ($(NEED_INET_ATON),yes)
  57. OBJS+= barpainet.o
  58. endif
  59. endif
  60. ifeq ($(CONFIG_LIBOGG),yes)
  61. OBJS+= ogg.o
  62. endif
  63. ifeq ($(TARGET_ARCH_SPARC64),yes)
  64. CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
  65. endif
  66. LIB= $(LIBPREF)avformat$(LIBSUF)
  67. ifeq ($(BUILD_SHARED),yes)
  68. SLIBNAME= $(SLIBPREF)avformat$(SLIBSUF)
  69. AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
  70. ifeq ($(CONFIG_DARWIN),yes)
  71. SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION)
  72. endif
  73. ifeq ($(CONFIG_MP3LAME),yes)
  74. AVCLIBS+=-lmp3lame
  75. endif
  76. endif
  77. SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
  78. all: $(LIB) $(SLIBNAME)
  79. $(LIB): $(OBJS) $(PPOBJS)
  80. rm -f $@
  81. $(AR) rc $@ $(OBJS) $(PPOBJS)
  82. $(RANLIB) $@
  83. $(SLIBNAME): $(OBJS)
  84. ifeq ($(CONFIG_WIN32),yes)
  85. $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
  86. -lib /machine:i386 /def:$(@:.dll=.def)
  87. else
  88. $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
  89. endif
  90. depend: $(SRCS)
  91. $(CC) -MM $(CFLAGS) $^ 1>.depend
  92. ifeq ($(BUILD_SHARED),yes)
  93. install: all install-headers
  94. ifeq ($(CONFIG_WIN32),yes)
  95. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
  96. else
  97. install -d $(libdir)
  98. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/$(SLIBPREF)avformat-$(VERSION)$(SLIBSUF)
  99. ln -sf $(SLIBPREF)avformat-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
  100. $(LDCONFIG) || true
  101. endif
  102. else
  103. install:
  104. endif
  105. installlib: all install-headers
  106. install -m 644 $(LIB) "$(libdir)"
  107. install-headers:
  108. mkdir -p "$(prefix)/include/ffmpeg"
  109. install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
  110. $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
  111. $(SRC_PATH)/libavformat/rtspcodes.h \
  112. "$(prefix)/include/ffmpeg"
  113. install -d $(libdir)/pkgconfig
  114. install -m 644 ../libavformat.pc $(libdir)/pkgconfig
  115. %.o: %.c
  116. $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
  117. # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
  118. %.o: %.cpp
  119. g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
  120. distclean clean:
  121. rm -f *.o *.d .depend *~ *.a *$(SLIBSUF) $(LIB)
  122. #
  123. # include dependency files if they exist
  124. #
  125. ifneq ($(wildcard .depend),)
  126. include .depend
  127. endif