Yamaha SMAF file format support patch by (Vidar Madsen: vidarino, gmail com)
[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
cf9d24ad 9CFLAGS=$(OPTFLAGS) -I.. -I$(SRC_PATH) -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 \
bcfc40ae 20 ogg2.o oggparsevorbis.o oggparsetheora.o oggparseflac.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
dfdfa47c 59ifeq ($(CONFIG_AUDIO_BEOS),yes)
cc0799e5 60PPOBJS+= beosaudio.o
aa35ccb8 61EXTRALIBS+=-lbe -lmedia
dfdfa47c
FR
62endif
63
19720f15 64ifeq ($(CONFIG_NETWORK),yes)
bdd7d518 65OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
cc0799e5 66# BeOS and Darwin network stuff
4baca069 67ifeq ($(NEED_INET_ATON),yes)
9ddd71fc
FR
68OBJS+= barpainet.o
69endif
a74127c0
FB
70endif
71
5c5dea3f 72ifeq ($(CONFIG_LIBOGG),yes)
81e0d0b4
MH
73OBJS+= ogg.o
74endif
75
bb476ff3
JM
76ifeq ($(TARGET_ARCH_SPARC64),yes)
77CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
78endif
79
f3ec2d46 80LIB= $(LIBPREF)avformat$(LIBSUF)
6bc114b2
TA
81ifeq ($(BUILD_SHARED),yes)
82SLIB= $(SLIBPREF)avformat$(SLIBSUF)
85f07f22 83
eb94aca9 84AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec
27d5f18f 85ifeq ($(CONFIG_MP3LAME),yes)
efd9e75c
MN
86AVCLIBS+=-lmp3lame
87endif
27d5f18f
FR
88endif
89
cc0799e5 90SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
77b71ddc 91
6bc114b2 92all: $(LIB) $(SLIB)
85f07f22 93
cc0799e5 94$(LIB): $(OBJS) $(PPOBJS)
85f07f22 95 rm -f $@
cc0799e5 96 $(AR) rc $@ $(OBJS) $(PPOBJS)
be7109c1 97 $(RANLIB) $@
85f07f22 98
6bc114b2 99$(SLIB): $(OBJS)
cb728d79 100ifeq ($(CONFIG_WIN32),yes)
1f8f50ef 101 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
a17236c5
MN
102 -lib /machine:i386 /def:$(@:.dll=.def)
103else
56b04ceb 104 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
a17236c5 105endif
6bc114b2 106
f8d7b5f5 107depend: $(SRCS)
7c235fe2
FB
108 $(CC) -MM $(CFLAGS) $^ 1>.depend
109
6bc114b2 110ifeq ($(BUILD_SHARED),yes)
cb728d79
FB
111install: all install-headers
112ifeq ($(CONFIG_WIN32),yes)
65d1bea2 113 install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
cb728d79 114else
cc973ecb
LB
115 install -d $(libdir)
116 install $(INSTALLSTRIP) -m 755 $(SLIB) $(libdir)/libavformat-$(VERSION).so
117 ln -sf libavformat-$(VERSION).so $(libdir)/libavformat.so
f39e56a8 118 $(LDCONFIG) || true
cb728d79
FB
119endif
120else
121install:
6bc114b2
TA
122endif
123
cb728d79 124installlib: all install-headers
cc973ecb 125 install -m 644 $(LIB) "$(libdir)"
cb728d79
FB
126
127install-headers:
128 mkdir -p "$(prefix)/include/ffmpeg"
f60f0df1
TJ
129 install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
130 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
131 $(SRC_PATH)/libavformat/rtspcodes.h \
cb728d79 132 "$(prefix)/include/ffmpeg"
def4272a
AJ
133 install -d $(libdir)/pkgconfig
134 install -m 644 ../libavformat.pc $(libdir)/pkgconfig
910fdd21 135
85f07f22 136%.o: %.c
80581e98 137 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
85f07f22 138
dfdfa47c
FR
139# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
140%.o: %.cpp
141 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
142
2fefb220 143distclean clean:
e1e98dbd 144 rm -f *.o *.d .depend *~ *.a *.so $(LIB)
7c235fe2
FB
145
146#
147# include dependency files if they exist
148#
149ifneq ($(wildcard .depend),)
150include .depend
151endif