Create symbolic links for all library sonames and clean up Makefiles.
[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 35# file I/O
115329f1
DB
36OBJS+= avio.o aviobuf.o file.o
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 55ifeq ($(CONFIG_AUDIO_OSS),yes)
115329f1 56OBJS+= audio.o
19720f15
FB
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)
f3b60109
DB
83LIBVERSION=$(LAVFVERSION)
84LIBMAJOR=$(LAVFMAJOR)
85NAME=avformat
4e159595
DB
86SLIBNAME= $(SLIBPREF)avformat$(SLIBSUF)
87AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
27d5f18f
FR
88endif
89
cc0799e5 90SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
77b71ddc 91
4e159595 92all: $(LIB) $(SLIBNAME)
85f07f22 93
cc0799e5 94$(LIB): $(OBJS) $(PPOBJS)
85f07f22 95 rm -f $@
cc0799e5 96 $(AR) rc $@ $(OBJS) $(PPOBJS)
be7109c1 97 $(RANLIB) $@
85f07f22 98
4e159595 99$(SLIBNAME): $(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)
4e159595 113 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
cb728d79 114else
cc973ecb 115 install -d $(libdir)
f3b60109
DB
116 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
117 $(libdir)/$(SLIBNAME_WITH_VERSION)
118 ln -sf $(SLIBNAME_WITH_VERSION) \
119 $(libdir)/$(SLIBNAME_WITH_MAJOR)
120 ln -sf $(SLIBNAME_WITH_VERSION) \
121 $(libdir)/$(SLIBNAME)
f39e56a8 122 $(LDCONFIG) || true
cb728d79
FB
123endif
124else
125install:
6bc114b2
TA
126endif
127
cb728d79 128installlib: all install-headers
cc973ecb 129 install -m 644 $(LIB) "$(libdir)"
cb728d79
FB
130
131install-headers:
132 mkdir -p "$(prefix)/include/ffmpeg"
f60f0df1
TJ
133 install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
134 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
135 $(SRC_PATH)/libavformat/rtspcodes.h \
cb728d79 136 "$(prefix)/include/ffmpeg"
25f8db58
FO
137 install -d "$(libdir)/pkgconfig"
138 install -m 644 ../libavformat.pc "$(libdir)/pkgconfig"
910fdd21 139
85f07f22 140%.o: %.c
115329f1 141 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
85f07f22 142
dfdfa47c
FR
143# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
144%.o: %.cpp
115329f1 145 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
dfdfa47c 146
115329f1 147distclean clean:
4e159595 148 rm -f *.o *.d .depend *~ *.a *$(SLIBSUF) $(LIB)
7c235fe2
FB
149
150#
151# include dependency files if they exist
152#
153ifneq ($(wildcard .depend),)
154include .depend
155endif