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.

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