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.

167 lines
3.5KB

  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. voc.o tta.o mm.o
  22. # muxers
  23. ifeq ($(CONFIG_MUXERS),yes)
  24. OBJS+= flvenc.o movenc.o asf-enc.o adtsenc.o
  25. endif
  26. AMROBJS=
  27. ifeq ($(AMR_NB),yes)
  28. AMROBJS= amr.o
  29. endif
  30. ifeq ($(AMR_NB_FIXED),yes)
  31. AMROBJS= amr.o
  32. endif
  33. ifeq ($(AMR_WB),yes)
  34. AMROBJS= amr.o
  35. endif
  36. OBJS+= $(AMROBJS)
  37. # image formats
  38. OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o
  39. OBJS+= framehook.o
  40. ifeq ($(CONFIG_VIDEO4LINUX),yes)
  41. OBJS+= grab.o
  42. endif
  43. ifeq ($(CONFIG_VIDEO4LINUX2),yes)
  44. OBJS+= v4l2.o
  45. endif
  46. ifeq ($(CONFIG_BKTR),yes)
  47. OBJS+= grab_bktr.o
  48. endif
  49. ifeq ($(CONFIG_DV1394),yes)
  50. OBJS+= dv1394.o
  51. endif
  52. ifeq ($(CONFIG_DC1394),yes)
  53. OBJS+= dc1394.o
  54. endif
  55. ifeq ($(CONFIG_AUDIO_OSS),yes)
  56. OBJS+= audio.o
  57. endif
  58. EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
  59. ifeq ($(CONFIG_AUDIO_BEOS),yes)
  60. PPOBJS+= beosaudio.o
  61. endif
  62. # protocols I/O
  63. OBJS+= avio.o aviobuf.o
  64. ifeq ($(CONFIG_PROTOCOLS),yes)
  65. OBJS+= file.o
  66. ifeq ($(CONFIG_NETWORK),yes)
  67. OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
  68. # BeOS and Darwin network stuff
  69. ifeq ($(NEED_INET_ATON),yes)
  70. OBJS+= barpainet.o
  71. endif
  72. endif
  73. endif
  74. ifeq ($(CONFIG_LIBOGG),yes)
  75. OBJS+= ogg.o
  76. endif
  77. ifeq ($(TARGET_ARCH_SPARC64),yes)
  78. CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
  79. endif
  80. NAME=avformat
  81. ifeq ($(BUILD_SHARED),yes)
  82. LIBVERSION=$(LAVFVERSION)
  83. LIBMAJOR=$(LAVFMAJOR)
  84. AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
  85. endif
  86. SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
  87. all: $(LIB) $(SLIBNAME)
  88. $(LIB): $(OBJS) $(PPOBJS)
  89. rm -f $@
  90. $(AR) rc $@ $(OBJS) $(PPOBJS)
  91. $(RANLIB) $@
  92. $(SLIBNAME): $(OBJS)
  93. $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
  94. ifeq ($(CONFIG_WIN32),yes)
  95. -lib /machine:i386 /def:$(@:.dll=.def)
  96. endif
  97. depend: $(SRCS)
  98. $(CC) -MM $(CFLAGS) $^ 1>.depend
  99. install-lib-shared: $(SLIBNAME)
  100. ifeq ($(CONFIG_WIN32),yes)
  101. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
  102. else
  103. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
  104. $(libdir)/$(SLIBNAME_WITH_VERSION)
  105. ln -sf $(SLIBNAME_WITH_VERSION) \
  106. $(libdir)/$(SLIBNAME_WITH_MAJOR)
  107. ln -sf $(SLIBNAME_WITH_VERSION) \
  108. $(libdir)/$(SLIBNAME)
  109. endif
  110. install-lib-static: $(LIB)
  111. install -m 644 $(LIB) "$(libdir)"
  112. install-headers:
  113. install -m 644 avformat.h avio.h rtp.h rtsp.h rtspcodes.h "$(incdir)"
  114. install -m 644 $(SRC_PATH)/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. clean:
  121. rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll \
  122. *.lib *.def *.dll.a *.exp
  123. distclean: clean
  124. rm -f .depend
  125. #
  126. # include dependency files if they exist
  127. #
  128. ifneq ($(wildcard .depend),)
  129. include .depend
  130. endif