BeOS fix: NOT every ld likes undefined syms, include C++ objs, and link to libs neede...
[libav.git] / libavformat / Makefile
CommitLineData
19720f15
FB
1#
2# libavformat Makefile
3# (c) 2000, 2001, 2002 Fabrice Bellard
4#
980fc7b8 5include ../config.mak
f57a4535 6
a382b927 7VPATH=$(SRC_PATH)/libavformat
f57a4535 8
eddbd7e5 9CFLAGS= $(OPTFLAGS) -Wall -g -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
910fdd21 11OBJS= utils.o cutils.o allformats.o
cc0799e5 12PPOBJS=
c9a65ca8
FB
13
14# mux and demuxes
5dbafeb7 15OBJS+=mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.o raw.o rm.o \
0250738f 16 avienc.o avidec.o wav.o swf.o au.o gif.o mov.o mpjpeg.o dv.o \
d4f5d74a 17 yuv4mpeg.o 4xm.o flvenc.o flvdec.o
1d0d55da
MN
18
19ifeq ($(CONFIG_RISKY),yes)
20OBJS+= asf.o
21endif
22
bc634f6f
ZK
23ifeq ($(AMR_NB),yes)
24OBJS+= amr.o
25endif
26
87a0a681 27# image formats
85a57296 28OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o
c9a65ca8
FB
29# file I/O
30OBJS+= avio.o aviobuf.o file.o
87a0a681 31OBJS+= framehook.o
8be1c656 32
487ec9a0
PG
33ifeq ($(BUILD_STRPTIME),yes)
34OBJS+= strptime.o
35endif
36
19720f15
FB
37ifeq ($(CONFIG_VIDEO4LINUX),yes)
38OBJS+= grab.o
8be1c656 39endif
85f07f22 40
8aa3ee32
MK
41ifeq ($(CONFIG_DV1394),yes)
42OBJS+= dv1394.o
43endif
44
19720f15
FB
45ifeq ($(CONFIG_AUDIO_OSS),yes)
46OBJS+= audio.o
47endif
48
dfdfa47c 49ifeq ($(CONFIG_AUDIO_BEOS),yes)
cc0799e5 50PPOBJS+= beosaudio.o
aa35ccb8
FR
51EXTRALIBS+=-lbe -lmedia
52# this should be the default !
53EXTRALIBS+=-lavcodec -L../libavcodec
dfdfa47c
FR
54endif
55
19720f15 56ifeq ($(CONFIG_NETWORK),yes)
bdd7d518 57OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
cc0799e5 58# BeOS and Darwin network stuff
4baca069 59ifeq ($(NEED_INET_ATON),yes)
9ddd71fc
FR
60OBJS+= barpainet.o
61endif
a74127c0
FB
62endif
63
81e0d0b4
MH
64ifeq ($(CONFIG_VORBIS),yes)
65OBJS+= ogg.o
66endif
67
f3ec2d46 68LIB= $(LIBPREF)avformat$(LIBSUF)
6bc114b2
TA
69ifeq ($(BUILD_SHARED),yes)
70SLIB= $(SLIBPREF)avformat$(SLIBSUF)
71endif
85f07f22 72
cc0799e5 73SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
77b71ddc 74
6bc114b2 75all: $(LIB) $(SLIB)
85f07f22 76
cc0799e5 77$(LIB): $(OBJS) $(PPOBJS)
85f07f22 78 rm -f $@
cc0799e5 79 $(AR) rc $@ $(OBJS) $(PPOBJS)
be7109c1 80 $(RANLIB) $@
85f07f22 81
6bc114b2 82$(SLIB): $(OBJS)
aa35ccb8 83 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(AMREXTRALIBS)
6bc114b2 84
f8d7b5f5 85depend: $(SRCS)
7c235fe2
FB
86 $(CC) -MM $(CFLAGS) $^ 1>.depend
87
6bc114b2
TA
88install: all
89ifeq ($(BUILD_SHARED),yes)
90 install -d $(prefix)/lib
91 install -s -m 755 $(SLIB) $(prefix)/lib/libavformat-$(VERSION).so
92 ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so
93 ldconfig || true
94 mkdir -p $(prefix)/include/ffmpeg
95 install -m 644 $(VPATH)/avformat.h $(prefix)/include/ffmpeg/avformat.h
96 install -m 644 $(VPATH)/avio.h $(prefix)/include/ffmpeg/avio.h
97 install -m 644 $(VPATH)/rtp.h $(prefix)/include/ffmpeg/rtp.h
98 install -m 644 $(VPATH)/rtsp.h $(prefix)/include/ffmpeg/rtsp.h
99 install -m 644 $(VPATH)/rtspcodes.h $(prefix)/include/ffmpeg/rtspcodes.h
100endif
101
910fdd21
FB
102installlib: all
103 install -m 644 $(LIB) $(prefix)/lib
104 mkdir -p $(prefix)/include/ffmpeg
f60f0df1
TJ
105 install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
106 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
107 $(SRC_PATH)/libavformat/rtspcodes.h \
910fdd21
FB
108 $(prefix)/include/ffmpeg
109
85f07f22
FB
110%.o: %.c
111 $(CC) $(CFLAGS) -c -o $@ $<
112
dfdfa47c
FR
113# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
114%.o: %.cpp
115 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
116
85f07f22 117clean:
7c235fe2
FB
118 rm -f *.o *.d .depend *~ *.a $(LIB)
119
120#
121# include dependency files if they exist
122#
123ifneq ($(wildcard .depend),)
124include .depend
125endif