fixed windows build
[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
cddf3f45 9CFLAGS= $(OPTFLAGS) -Wall -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 \
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 \
6a58e151 18 nut.o wc3movie.o mp3.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
19720f15
FB
34ifeq ($(CONFIG_VIDEO4LINUX),yes)
35OBJS+= grab.o
8be1c656 36endif
85f07f22 37
8aa3ee32
MK
38ifeq ($(CONFIG_DV1394),yes)
39OBJS+= dv1394.o
40endif
41
19720f15
FB
42ifeq ($(CONFIG_AUDIO_OSS),yes)
43OBJS+= audio.o
44endif
45
dfdfa47c 46ifeq ($(CONFIG_AUDIO_BEOS),yes)
cc0799e5 47PPOBJS+= beosaudio.o
aa35ccb8
FR
48EXTRALIBS+=-lbe -lmedia
49# this should be the default !
50EXTRALIBS+=-lavcodec -L../libavcodec
dfdfa47c
FR
51endif
52
19720f15 53ifeq ($(CONFIG_NETWORK),yes)
bdd7d518 54OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
cc0799e5 55# BeOS and Darwin network stuff
4baca069 56ifeq ($(NEED_INET_ATON),yes)
9ddd71fc
FR
57OBJS+= barpainet.o
58endif
a74127c0
FB
59endif
60
81e0d0b4
MH
61ifeq ($(CONFIG_VORBIS),yes)
62OBJS+= ogg.o
63endif
64
f3ec2d46 65LIB= $(LIBPREF)avformat$(LIBSUF)
6bc114b2
TA
66ifeq ($(BUILD_SHARED),yes)
67SLIB= $(SLIBPREF)avformat$(SLIBSUF)
68endif
85f07f22 69
cc0799e5 70SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
77b71ddc 71
6bc114b2 72all: $(LIB) $(SLIB)
85f07f22 73
cc0799e5 74$(LIB): $(OBJS) $(PPOBJS)
85f07f22 75 rm -f $@
cc0799e5 76 $(AR) rc $@ $(OBJS) $(PPOBJS)
be7109c1 77 $(RANLIB) $@
85f07f22 78
6bc114b2 79$(SLIB): $(OBJS)
a17236c5
MN
80ifeq ($(TARGET_MINGW32),yes)
81 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(VPATH)/../libavcodec/avcodec.dll
82 -lib /machine:i386 /def:$(@:.dll=.def)
83else
84 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(AMREXTRALIBS)
85endif
6bc114b2 86
f8d7b5f5 87depend: $(SRCS)
7c235fe2
FB
88 $(CC) -MM $(CFLAGS) $^ 1>.depend
89
6bc114b2
TA
90install: all
91ifeq ($(BUILD_SHARED),yes)
92 install -d $(prefix)/lib
93 install -s -m 755 $(SLIB) $(prefix)/lib/libavformat-$(VERSION).so
94 ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so
95 ldconfig || true
96 mkdir -p $(prefix)/include/ffmpeg
97 install -m 644 $(VPATH)/avformat.h $(prefix)/include/ffmpeg/avformat.h
98 install -m 644 $(VPATH)/avio.h $(prefix)/include/ffmpeg/avio.h
99 install -m 644 $(VPATH)/rtp.h $(prefix)/include/ffmpeg/rtp.h
100 install -m 644 $(VPATH)/rtsp.h $(prefix)/include/ffmpeg/rtsp.h
101 install -m 644 $(VPATH)/rtspcodes.h $(prefix)/include/ffmpeg/rtspcodes.h
102endif
103
910fdd21
FB
104installlib: all
105 install -m 644 $(LIB) $(prefix)/lib
106 mkdir -p $(prefix)/include/ffmpeg
f60f0df1
TJ
107 install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
108 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
109 $(SRC_PATH)/libavformat/rtspcodes.h \
910fdd21
FB
110 $(prefix)/include/ffmpeg
111
85f07f22
FB
112%.o: %.c
113 $(CC) $(CFLAGS) -c -o $@ $<
114
dfdfa47c
FR
115# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
116%.o: %.cpp
117 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
118
85f07f22 119clean:
7c235fe2
FB
120 rm -f *.o *.d .depend *~ *.a $(LIB)
121
122#
123# include dependency files if they exist
124#
125ifneq ($(wildcard .depend),)
126include .depend
127endif