- Moving -Wall from the individual Makefiles to configure (and only
[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
5dbafeb7 15OBJS+=mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.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 \
4120a53a 18 nut.o wc3movie.o mp3.o westwood.o segafilm.o idcin.o
1d0d55da
MN
19
20ifeq ($(CONFIG_RISKY),yes)
21OBJS+= asf.o
22endif
23
485bc05d
AB
24ifeq ($(AMR_NB),yes)
25OBJS+= amr.o
26endif
27ifeq ($(AMR_NB_FIXED),yes)
28OBJS+= amr.o
29endif
30ifeq ($(AMR_WB),yes)
bc634f6f
ZK
31OBJS+= amr.o
32endif
33
87a0a681 34# image formats
85a57296 35OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o
c9a65ca8
FB
36# file I/O
37OBJS+= avio.o aviobuf.o file.o
87a0a681 38OBJS+= framehook.o
8be1c656 39
19720f15
FB
40ifeq ($(CONFIG_VIDEO4LINUX),yes)
41OBJS+= grab.o
8be1c656 42endif
85f07f22 43
8aa3ee32
MK
44ifeq ($(CONFIG_DV1394),yes)
45OBJS+= dv1394.o
46endif
47
19720f15
FB
48ifeq ($(CONFIG_AUDIO_OSS),yes)
49OBJS+= audio.o
50endif
51
dfdfa47c 52ifeq ($(CONFIG_AUDIO_BEOS),yes)
cc0799e5 53PPOBJS+= beosaudio.o
aa35ccb8
FR
54EXTRALIBS+=-lbe -lmedia
55# this should be the default !
56EXTRALIBS+=-lavcodec -L../libavcodec
dfdfa47c
FR
57endif
58
19720f15 59ifeq ($(CONFIG_NETWORK),yes)
bdd7d518 60OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
cc0799e5 61# BeOS and Darwin network stuff
4baca069 62ifeq ($(NEED_INET_ATON),yes)
9ddd71fc
FR
63OBJS+= barpainet.o
64endif
a74127c0
FB
65endif
66
81e0d0b4
MH
67ifeq ($(CONFIG_VORBIS),yes)
68OBJS+= ogg.o
69endif
70
f3ec2d46 71LIB= $(LIBPREF)avformat$(LIBSUF)
6bc114b2
TA
72ifeq ($(BUILD_SHARED),yes)
73SLIB= $(SLIBPREF)avformat$(SLIBSUF)
74endif
85f07f22 75
cc0799e5 76SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
77b71ddc 77
6bc114b2 78all: $(LIB) $(SLIB)
85f07f22 79
cc0799e5 80$(LIB): $(OBJS) $(PPOBJS)
85f07f22 81 rm -f $@
cc0799e5 82 $(AR) rc $@ $(OBJS) $(PPOBJS)
be7109c1 83 $(RANLIB) $@
85f07f22 84
6bc114b2 85$(SLIB): $(OBJS)
cb728d79 86ifeq ($(CONFIG_WIN32),yes)
165f74ff 87 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(VPATH)/../libavcodec/avcodec.dll
a17236c5
MN
88 -lib /machine:i386 /def:$(@:.dll=.def)
89else
165f74ff 90 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS)
a17236c5 91endif
6bc114b2 92
f8d7b5f5 93depend: $(SRCS)
7c235fe2
FB
94 $(CC) -MM $(CFLAGS) $^ 1>.depend
95
6bc114b2 96ifeq ($(BUILD_SHARED),yes)
cb728d79
FB
97install: all install-headers
98ifeq ($(CONFIG_WIN32),yes)
99 install -s -m 755 $(SLIB) "$(prefix)"
100else
6bc114b2
TA
101 install -d $(prefix)/lib
102 install -s -m 755 $(SLIB) $(prefix)/lib/libavformat-$(VERSION).so
103 ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so
104 ldconfig || true
cb728d79
FB
105endif
106else
107install:
6bc114b2
TA
108endif
109
cb728d79 110installlib: all install-headers
910fdd21 111 install -m 644 $(LIB) $(prefix)/lib
cb728d79
FB
112
113install-headers:
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 \
cb728d79 118 "$(prefix)/include/ffmpeg"
910fdd21 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