]> git.sesse.net Git - ffmpeg/blob - libavformat/Makefile
Add --disable-protocols option to configure to disable I/O protocol from
[ffmpeg] / libavformat / Makefile
1 #
2 # libavformat Makefile
3 # (c) 2000-2003 Fabrice Bellard
4 #
5 include ../config.mak
6
7 VPATH=$(SRC_PATH)/libavformat
8
9 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
10
11 OBJS= utils.o cutils.o os_support.o allformats.o
12 PPOBJS=
13
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
21
22 # muxers
23 ifeq ($(CONFIG_MUXERS),yes)
24 OBJS+= flvenc.o movenc.o asf-enc.o
25 endif
26
27
28 AMROBJS=
29 ifeq ($(AMR_NB),yes)
30 AMROBJS= amr.o
31 endif
32 ifeq ($(AMR_NB_FIXED),yes)
33 AMROBJS= amr.o
34 endif
35 ifeq ($(AMR_WB),yes)
36 AMROBJS= amr.o
37 endif
38 OBJS+= $(AMROBJS)
39
40 # image formats
41 OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o
42 OBJS+= framehook.o
43
44 ifeq ($(CONFIG_VIDEO4LINUX),yes)
45 OBJS+= grab.o
46 endif
47
48 ifeq ($(CONFIG_BKTR),yes)
49 OBJS+= grab_bktr.o
50 endif
51
52 ifeq ($(CONFIG_DV1394),yes)
53 OBJS+= dv1394.o
54 endif
55
56 ifeq ($(CONFIG_DC1394),yes)
57 OBJS+= dc1394.o
58 endif
59
60 ifeq ($(CONFIG_AUDIO_OSS),yes)
61 OBJS+= audio.o
62 endif
63
64 EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
65
66 ifeq ($(CONFIG_AUDIO_BEOS),yes)
67 PPOBJS+= beosaudio.o
68 endif
69
70 # protocols I/O
71 OBJS+= avio.o aviobuf.o
72
73 ifeq ($(CONFIG_PROTOCOLS),yes)
74 OBJS+= file.o
75 ifeq ($(CONFIG_NETWORK),yes)
76 OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
77 # BeOS and Darwin network stuff
78 ifeq ($(NEED_INET_ATON),yes)
79 OBJS+= barpainet.o
80 endif
81 endif
82 endif
83
84 ifeq ($(CONFIG_LIBOGG),yes)
85 OBJS+= ogg.o
86 endif
87
88 ifeq ($(TARGET_ARCH_SPARC64),yes)
89 CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
90 endif
91
92 NAME=avformat
93 ifeq ($(BUILD_SHARED),yes)
94 LIBVERSION=$(LAVFVERSION)
95 LIBMAJOR=$(LAVFMAJOR)
96 AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
97 endif
98
99 SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
100
101 all: $(LIB) $(SLIBNAME)
102
103 $(LIB): $(OBJS) $(PPOBJS)
104         rm -f $@
105         $(AR) rc $@ $(OBJS) $(PPOBJS)
106         $(RANLIB) $@
107
108 $(SLIBNAME): $(OBJS)
109 ifeq ($(CONFIG_WIN32),yes)
110         $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
111         -lib /machine:i386 /def:$(@:.dll=.def)
112 else
113         $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
114 endif
115
116 depend: $(SRCS)
117         $(CC) -MM $(CFLAGS) $^ 1>.depend
118
119 ifeq ($(BUILD_SHARED),yes)
120 install: all install-headers
121 ifeq ($(CONFIG_WIN32),yes)
122         install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
123 else
124         install -d $(libdir)
125         install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
126                 $(libdir)/$(SLIBNAME_WITH_VERSION)
127         ln -sf $(SLIBNAME_WITH_VERSION) \
128                 $(libdir)/$(SLIBNAME_WITH_MAJOR)
129         ln -sf $(SLIBNAME_WITH_VERSION) \
130                 $(libdir)/$(SLIBNAME)
131         $(LDCONFIG) || true
132 endif
133 else
134 install:
135 endif
136
137 installlib: all install-headers
138         install -m 644 $(LIB) "$(libdir)"
139
140 install-headers:
141         mkdir -p "$(prefix)/include/ffmpeg"
142         install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
143                 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
144                 $(SRC_PATH)/libavformat/rtspcodes.h \
145                 "$(prefix)/include/ffmpeg"
146         install -d "$(libdir)/pkgconfig"
147         install -m 644 ../libavformat.pc "$(libdir)/pkgconfig"
148
149 %.o: %.c
150         $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
151
152 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
153 %.o: %.cpp
154         g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
155
156 clean:
157         rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll
158
159 distclean: clean
160         rm -f Makefile.bak .depend
161
162 #
163 # include dependency files if they exist
164 #
165 ifneq ($(wildcard .depend),)
166 include .depend
167 endif