Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. endif
  52. ifeq ($(CONFIG_NETWORK),yes)
  53. OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
  54. # BeOS and Darwin network stuff
  55. ifeq ($(NEED_INET_ATON),yes)
  56. OBJS+= barpainet.o
  57. endif
  58. endif
  59. ifeq ($(CONFIG_LIBOGG),yes)
  60. OBJS+= ogg.o
  61. endif
  62. ifeq ($(TARGET_ARCH_SPARC64),yes)
  63. CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
  64. endif
  65. NAME=avformat
  66. ifeq ($(BUILD_SHARED),yes)
  67. LIBVERSION=$(LAVFVERSION)
  68. LIBMAJOR=$(LAVFMAJOR)
  69. AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
  70. endif
  71. SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
  72. all: $(LIB) $(SLIBNAME)
  73. $(LIB): $(OBJS) $(PPOBJS)
  74. rm -f $@
  75. $(AR) rc $@ $(OBJS) $(PPOBJS)
  76. $(RANLIB) $@
  77. $(SLIBNAME): $(OBJS)
  78. ifeq ($(CONFIG_WIN32),yes)
  79. $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
  80. -lib /machine:i386 /def:$(@:.dll=.def)
  81. else
  82. $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
  83. endif
  84. depend: $(SRCS)
  85. $(CC) -MM $(CFLAGS) $^ 1>.depend
  86. ifeq ($(BUILD_SHARED),yes)
  87. install: all install-headers
  88. ifeq ($(CONFIG_WIN32),yes)
  89. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
  90. else
  91. install -d $(libdir)
  92. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
  93. $(libdir)/$(SLIBNAME_WITH_VERSION)
  94. ln -sf $(SLIBNAME_WITH_VERSION) \
  95. $(libdir)/$(SLIBNAME_WITH_MAJOR)
  96. ln -sf $(SLIBNAME_WITH_VERSION) \
  97. $(libdir)/$(SLIBNAME)
  98. $(LDCONFIG) || true
  99. endif
  100. else
  101. install:
  102. endif
  103. installlib: all install-headers
  104. install -m 644 $(LIB) "$(libdir)"
  105. install-headers:
  106. mkdir -p "$(prefix)/include/ffmpeg"
  107. install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
  108. $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
  109. $(SRC_PATH)/libavformat/rtspcodes.h \
  110. "$(prefix)/include/ffmpeg"
  111. install -d "$(libdir)/pkgconfig"
  112. install -m 644 ../libavformat.pc "$(libdir)/pkgconfig"
  113. %.o: %.c
  114. $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
  115. # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
  116. %.o: %.cpp
  117. g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
  118. clean:
  119. rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll
  120. distclean: clean
  121. rm -f Makefile.bak .depend
  122. #
  123. # include dependency files if they exist
  124. #
  125. ifneq ($(wildcard .depend),)
  126. include .depend
  127. endif