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