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