removed os_support.h
[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
36b58e85 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 \
118e91f3 16 avienc.o avidec.o wav.o swf.o au.o gif.o mov.o mpjpeg.o dvcore.o dv.o \
3aa180b8 17 yuv4mpeg.o 4xm.o flvenc.o flvdec.o movenc.o psxstr.o idroq.o ipmovie.o \
493645eb 18 nut.o wc3movie.o
1d0d55da
MN
19
20ifeq ($(CONFIG_RISKY),yes)
21OBJS+= asf.o
22endif
23
bc634f6f
ZK
24ifeq ($(AMR_NB),yes)
25OBJS+= amr.o
26endif
27
87a0a681 28# image formats
85a57296 29OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o
c9a65ca8
FB
30# file I/O
31OBJS+= avio.o aviobuf.o file.o
87a0a681 32OBJS+= framehook.o
8be1c656 33
487ec9a0
PG
34ifeq ($(BUILD_STRPTIME),yes)
35OBJS+= strptime.o
36endif
37
5e4639e2
GM
38ifeq ($(BUILD_LOCALTIME_R),yes)
39OBJS+= localtime_r.o
40endif
41
19720f15
FB
42ifeq ($(CONFIG_VIDEO4LINUX),yes)
43OBJS+= grab.o
8be1c656 44endif
85f07f22 45
8aa3ee32
MK
46ifeq ($(CONFIG_DV1394),yes)
47OBJS+= dv1394.o
48endif
49
19720f15
FB
50ifeq ($(CONFIG_AUDIO_OSS),yes)
51OBJS+= audio.o
52endif
53
dfdfa47c 54ifeq ($(CONFIG_AUDIO_BEOS),yes)
cc0799e5 55PPOBJS+= beosaudio.o
aa35ccb8
FR
56EXTRALIBS+=-lbe -lmedia
57# this should be the default !
58EXTRALIBS+=-lavcodec -L../libavcodec
dfdfa47c
FR
59endif
60
19720f15 61ifeq ($(CONFIG_NETWORK),yes)
bdd7d518 62OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
cc0799e5 63# BeOS and Darwin network stuff
4baca069 64ifeq ($(NEED_INET_ATON),yes)
9ddd71fc
FR
65OBJS+= barpainet.o
66endif
a74127c0
FB
67endif
68
81e0d0b4
MH
69ifeq ($(CONFIG_VORBIS),yes)
70OBJS+= ogg.o
71endif
72
f3ec2d46 73LIB= $(LIBPREF)avformat$(LIBSUF)
6bc114b2
TA
74ifeq ($(BUILD_SHARED),yes)
75SLIB= $(SLIBPREF)avformat$(SLIBSUF)
76endif
85f07f22 77
cc0799e5 78SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
77b71ddc 79
6bc114b2 80all: $(LIB) $(SLIB)
85f07f22 81
cc0799e5 82$(LIB): $(OBJS) $(PPOBJS)
85f07f22 83 rm -f $@
cc0799e5 84 $(AR) rc $@ $(OBJS) $(PPOBJS)
be7109c1 85 $(RANLIB) $@
85f07f22 86
6bc114b2 87$(SLIB): $(OBJS)
a17236c5
MN
88ifeq ($(TARGET_MINGW32),yes)
89 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(VPATH)/../libavcodec/avcodec.dll
90 -lib /machine:i386 /def:$(@:.dll=.def)
91else
92 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(AMREXTRALIBS)
93endif
6bc114b2 94
f8d7b5f5 95depend: $(SRCS)
7c235fe2
FB
96 $(CC) -MM $(CFLAGS) $^ 1>.depend
97
6bc114b2
TA
98install: all
99ifeq ($(BUILD_SHARED),yes)
100 install -d $(prefix)/lib
101 install -s -m 755 $(SLIB) $(prefix)/lib/libavformat-$(VERSION).so
102 ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so
103 ldconfig || true
104 mkdir -p $(prefix)/include/ffmpeg
105 install -m 644 $(VPATH)/avformat.h $(prefix)/include/ffmpeg/avformat.h
106 install -m 644 $(VPATH)/avio.h $(prefix)/include/ffmpeg/avio.h
107 install -m 644 $(VPATH)/rtp.h $(prefix)/include/ffmpeg/rtp.h
108 install -m 644 $(VPATH)/rtsp.h $(prefix)/include/ffmpeg/rtsp.h
109 install -m 644 $(VPATH)/rtspcodes.h $(prefix)/include/ffmpeg/rtspcodes.h
110endif
111
910fdd21
FB
112installlib: all
113 install -m 644 $(LIB) $(prefix)/lib
114 mkdir -p $(prefix)/include/ffmpeg
f60f0df1
TJ
115 install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
116 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
117 $(SRC_PATH)/libavformat/rtspcodes.h \
910fdd21
FB
118 $(prefix)/include/ffmpeg
119
85f07f22
FB
120%.o: %.c
121 $(CC) $(CFLAGS) -c -o $@ $<
122
dfdfa47c
FR
123# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
124%.o: %.cpp
125 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
126
85f07f22 127clean:
7c235fe2
FB
128 rm -f *.o *.d .depend *~ *.a $(LIB)
129
130#
131# include dependency files if they exist
132#
133ifneq ($(wildcard .depend),)
134include .depend
135endif