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