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