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