malloc padding to avoid reading past the malloc()ed area.
[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
FB
13
14# mux and demuxes
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 \
3aa180b8 17 yuv4mpeg.o 4xm.o flvenc.o flvdec.o movenc.o psxstr.o idroq.o ipmovie.o \
a7eb3c8d 18 nut.o wc3movie.o mp3.o westwood.o segafilm.o idcin.o flic.o \
9146ca37 19 sierravmd.o matroska.o sol.o electronicarts.o nsvdec.o asf.o asf-enc.o \
b93f738f 20 ogg2.o oggparsevorbis.o oggparsetheora.o oggparseflac.o daud.o
4d4bb927 21AMROBJS=
485bc05d 22ifeq ($(AMR_NB),yes)
4d4bb927 23AMROBJS= amr.o
485bc05d
AB
24endif
25ifeq ($(AMR_NB_FIXED),yes)
4d4bb927 26AMROBJS= amr.o
485bc05d
AB
27endif
28ifeq ($(AMR_WB),yes)
4d4bb927 29AMROBJS= amr.o
bc634f6f 30endif
4d4bb927 31OBJS+= $(AMROBJS)
bc634f6f 32
87a0a681 33# image formats
6a91ec51 34OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o
c9a65ca8
FB
35# file I/O
36OBJS+= avio.o aviobuf.o file.o
87a0a681 37OBJS+= framehook.o
8be1c656 38
19720f15
FB
39ifeq ($(CONFIG_VIDEO4LINUX),yes)
40OBJS+= grab.o
8be1c656 41endif
85f07f22 42
6beefa40
MN
43ifeq ($(CONFIG_BKTR),yes)
44OBJS+= grab_bktr.o
45endif
46
8aa3ee32
MK
47ifeq ($(CONFIG_DV1394),yes)
48OBJS+= dv1394.o
49endif
50
f02be79d
RS
51ifeq ($(CONFIG_DC1394),yes)
52OBJS+= dc1394.o
53endif
54
19720f15
FB
55ifeq ($(CONFIG_AUDIO_OSS),yes)
56OBJS+= audio.o
57endif
58
a71a1dfc 59EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
dbbcfd6b 60
dfdfa47c 61ifeq ($(CONFIG_AUDIO_BEOS),yes)
cc0799e5 62PPOBJS+= beosaudio.o
dfdfa47c
FR
63endif
64
19720f15 65ifeq ($(CONFIG_NETWORK),yes)
bdd7d518 66OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
cc0799e5 67# BeOS and Darwin network stuff
4baca069 68ifeq ($(NEED_INET_ATON),yes)
9ddd71fc
FR
69OBJS+= barpainet.o
70endif
a74127c0
FB
71endif
72
5c5dea3f 73ifeq ($(CONFIG_LIBOGG),yes)
81e0d0b4
MH
74OBJS+= ogg.o
75endif
76
bb476ff3
JM
77ifeq ($(TARGET_ARCH_SPARC64),yes)
78CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
79endif
80
f3ec2d46 81LIB= $(LIBPREF)avformat$(LIBSUF)
6bc114b2 82ifeq ($(BUILD_SHARED),yes)
5a872801 83LIBVERSION=$(LAVFMAJOR)
4e159595
DB
84SLIBNAME= $(SLIBPREF)avformat$(SLIBSUF)
85AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
86ifeq ($(CONFIG_DARWIN),yes)
87SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION)
88endif
27d5f18f
FR
89endif
90
cc0799e5 91SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
77b71ddc 92
4e159595 93all: $(LIB) $(SLIBNAME)
85f07f22 94
cc0799e5 95$(LIB): $(OBJS) $(PPOBJS)
85f07f22 96 rm -f $@
cc0799e5 97 $(AR) rc $@ $(OBJS) $(PPOBJS)
be7109c1 98 $(RANLIB) $@
85f07f22 99
4e159595 100$(SLIBNAME): $(OBJS)
cb728d79 101ifeq ($(CONFIG_WIN32),yes)
1f8f50ef 102 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
a17236c5
MN
103 -lib /machine:i386 /def:$(@:.dll=.def)
104else
56b04ceb 105 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
a17236c5 106endif
6bc114b2 107
f8d7b5f5 108depend: $(SRCS)
7c235fe2
FB
109 $(CC) -MM $(CFLAGS) $^ 1>.depend
110
6bc114b2 111ifeq ($(BUILD_SHARED),yes)
cb728d79
FB
112install: all install-headers
113ifeq ($(CONFIG_WIN32),yes)
4e159595 114 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
cb728d79 115else
cc973ecb 116 install -d $(libdir)
4e159595
DB
117 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/$(SLIBPREF)avformat-$(VERSION)$(SLIBSUF)
118 ln -sf $(SLIBPREF)avformat-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
f39e56a8 119 $(LDCONFIG) || true
cb728d79
FB
120endif
121else
122install:
6bc114b2
TA
123endif
124
cb728d79 125installlib: all install-headers
cc973ecb 126 install -m 644 $(LIB) "$(libdir)"
cb728d79
FB
127
128install-headers:
129 mkdir -p "$(prefix)/include/ffmpeg"
f60f0df1
TJ
130 install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
131 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
132 $(SRC_PATH)/libavformat/rtspcodes.h \
cb728d79 133 "$(prefix)/include/ffmpeg"
25f8db58
FO
134 install -d "$(libdir)/pkgconfig"
135 install -m 644 ../libavformat.pc "$(libdir)/pkgconfig"
910fdd21 136
85f07f22 137%.o: %.c
80581e98 138 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
85f07f22 139
dfdfa47c
FR
140# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
141%.o: %.cpp
142 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
143
2fefb220 144distclean clean:
4e159595 145 rm -f *.o *.d .depend *~ *.a *$(SLIBSUF) $(LIB)
7c235fe2
FB
146
147#
148# include dependency files if they exist
149#
150ifneq ($(wildcard .depend),)
151include .depend
152endif