video4linux2 input support
[libav.git] / libavformat / Makefile
CommitLineData
19720f15
FB
1#
2# libavformat Makefile
165f74ff 3# (c) 2000-2003 Fabrice Bellard
19720f15 4#
980fc7b8 5include ../config.mak
f57a4535 6
a382b927 7VPATH=$(SRC_PATH)/libavformat
f57a4535 8
c11c2bc2 9CFLAGS=$(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
85f07f22 10
c0af3840
DB
11#FIXME: This should be in configure/config.mak
12ifeq ($(CONFIG_WIN32),yes)
320d060a 13 LDFLAGS=-Wl,--output-def,$(@:.dll=.def),--out-implib,lib$(SLIBNAME:$(SLIBSUF)=.dll.a)
c0af3840
DB
14endif
15
f71869a4 16OBJS= utils.o cutils.o os_support.o allformats.o
cc0799e5 17PPOBJS=
c9a65ca8 18
04f46ced 19# demuxers
03cfe134 20OBJS+=mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.o img2.o raw.o rm.o \
93a23627 21 avienc.o avidec.o wav.o mmf.o swf.o au.o gif.o mov.o mpjpeg.o dv.o \
04f46ced 22 yuv4mpeg.o 4xm.o flvdec.o psxstr.o idroq.o ipmovie.o \
a7eb3c8d 23 nut.o wc3movie.o mp3.o westwood.o segafilm.o idcin.o flic.o \
04f46ced 24 sierravmd.o matroska.o sol.o electronicarts.o nsvdec.o asf.o \
b93f738f 25 ogg2.o oggparsevorbis.o oggparsetheora.o oggparseflac.o daud.o
04f46ced
GB
26
27# muxers
28ifeq ($(CONFIG_MUXERS),yes)
29OBJS+= flvenc.o movenc.o asf-enc.o
30endif
31
32
4d4bb927 33AMROBJS=
485bc05d 34ifeq ($(AMR_NB),yes)
4d4bb927 35AMROBJS= amr.o
485bc05d
AB
36endif
37ifeq ($(AMR_NB_FIXED),yes)
4d4bb927 38AMROBJS= amr.o
485bc05d
AB
39endif
40ifeq ($(AMR_WB),yes)
4d4bb927 41AMROBJS= amr.o
bc634f6f 42endif
4d4bb927 43OBJS+= $(AMROBJS)
bc634f6f 44
87a0a681 45# image formats
6a91ec51 46OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o
115329f1 47OBJS+= framehook.o
8be1c656 48
19720f15
FB
49ifeq ($(CONFIG_VIDEO4LINUX),yes)
50OBJS+= grab.o
8be1c656 51endif
85f07f22 52
0a7b514f
LA
53ifeq ($(CONFIG_VIDEO4LINUX2),yes)
54OBJS+= v4l2.o
55endif
56
6beefa40
MN
57ifeq ($(CONFIG_BKTR),yes)
58OBJS+= grab_bktr.o
59endif
60
8aa3ee32
MK
61ifeq ($(CONFIG_DV1394),yes)
62OBJS+= dv1394.o
63endif
64
f02be79d
RS
65ifeq ($(CONFIG_DC1394),yes)
66OBJS+= dc1394.o
67endif
68
19720f15 69ifeq ($(CONFIG_AUDIO_OSS),yes)
115329f1 70OBJS+= audio.o
19720f15
FB
71endif
72
a71a1dfc 73EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
dbbcfd6b 74
dfdfa47c 75ifeq ($(CONFIG_AUDIO_BEOS),yes)
cc0799e5 76PPOBJS+= beosaudio.o
dfdfa47c
FR
77endif
78
04f46ced
GB
79# protocols I/O
80OBJS+= avio.o aviobuf.o
81
82ifeq ($(CONFIG_PROTOCOLS),yes)
83OBJS+= file.o
19720f15 84ifeq ($(CONFIG_NETWORK),yes)
bdd7d518 85OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
cc0799e5 86# BeOS and Darwin network stuff
4baca069 87ifeq ($(NEED_INET_ATON),yes)
9ddd71fc
FR
88OBJS+= barpainet.o
89endif
a74127c0 90endif
04f46ced 91endif
a74127c0 92
5c5dea3f 93ifeq ($(CONFIG_LIBOGG),yes)
81e0d0b4
MH
94OBJS+= ogg.o
95endif
96
bb476ff3
JM
97ifeq ($(TARGET_ARCH_SPARC64),yes)
98CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
99endif
100
4bdd05e7 101NAME=avformat
6bc114b2 102ifeq ($(BUILD_SHARED),yes)
f3b60109
DB
103LIBVERSION=$(LAVFVERSION)
104LIBMAJOR=$(LAVFMAJOR)
4e159595 105AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
27d5f18f
FR
106endif
107
cc0799e5 108SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
77b71ddc 109
4e159595 110all: $(LIB) $(SLIBNAME)
85f07f22 111
cc0799e5 112$(LIB): $(OBJS) $(PPOBJS)
85f07f22 113 rm -f $@
cc0799e5 114 $(AR) rc $@ $(OBJS) $(PPOBJS)
be7109c1 115 $(RANLIB) $@
85f07f22 116
4e159595 117$(SLIBNAME): $(OBJS)
c0af3840 118 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
cb728d79 119ifeq ($(CONFIG_WIN32),yes)
a17236c5 120 -lib /machine:i386 /def:$(@:.dll=.def)
a17236c5 121endif
6bc114b2 122
f8d7b5f5 123depend: $(SRCS)
7c235fe2
FB
124 $(CC) -MM $(CFLAGS) $^ 1>.depend
125
6bc114b2 126ifeq ($(BUILD_SHARED),yes)
cb728d79
FB
127install: all install-headers
128ifeq ($(CONFIG_WIN32),yes)
4e159595 129 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
cb728d79 130else
cc973ecb 131 install -d $(libdir)
f3b60109
DB
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)
f39e56a8 138 $(LDCONFIG) || true
cb728d79
FB
139endif
140else
141install:
6bc114b2
TA
142endif
143
cb728d79 144installlib: all install-headers
cc973ecb 145 install -m 644 $(LIB) "$(libdir)"
cb728d79
FB
146
147install-headers:
148 mkdir -p "$(prefix)/include/ffmpeg"
f60f0df1
TJ
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 \
cb728d79 152 "$(prefix)/include/ffmpeg"
25f8db58
FO
153 install -d "$(libdir)/pkgconfig"
154 install -m 644 ../libavformat.pc "$(libdir)/pkgconfig"
910fdd21 155
85f07f22 156%.o: %.c
115329f1 157 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
85f07f22 158
dfdfa47c
FR
159# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
160%.o: %.cpp
115329f1 161 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
dfdfa47c 162
98013cc1 163clean:
320d060a
DB
164 rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll \
165 *.lib *.def *.dll.a *.exp
98013cc1
DB
166
167distclean: clean
04c07634 168 rm -f .depend
7c235fe2
FB
169
170#
171# include dependency files if they exist
172#
173ifneq ($(wildcard .depend),)
174include .depend
175endif