dependency handling is consistant with libavcodec
[libav.git] / libavformat / Makefile
1 #
2 # libavformat Makefile
3 # (c) 2000, 2001, 2002 Fabrice Bellard
4 #
5 include ../config.mak
6
7 VPATH=$(SRC_PATH)/libavformat
8
9 CFLAGS= $(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
10
11 OBJS= utils.o cutils.o allformats.o
12
13 # mux and demuxes
14 OBJS+=mpeg.o mpegts.o ffm.o crc.o img.o raw.o rm.o asf.o \
15 avienc.o avidec.o wav.o swf.o au.o gif.o mov.o jpeg.o dv.o \
16 yuv4mpeg.o
17 # image formats
18 OBJS+= pnm.o yuv.o
19 # file I/O
20 OBJS+= avio.o aviobuf.o file.o
21 OBJS+= framehook.o
22
23 ifeq ($(BUILD_STRPTIME),yes)
24 OBJS+= strptime.o
25 endif
26
27 ifeq ($(CONFIG_VIDEO4LINUX),yes)
28 OBJS+= grab.o
29 endif
30
31 ifeq ($(CONFIG_AUDIO_OSS),yes)
32 OBJS+= audio.o
33 endif
34
35 ifeq ($(CONFIG_AUDIO_BEOS),yes)
36 OBJS+= beosaudio.o
37 endif
38
39 ifeq ($(CONFIG_NETWORK),yes)
40 OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
41 # BeOS network stuff
42 ifeq ($(NEED_INET_ATON),yes)
43 OBJS+= barpainet.o
44 endif
45 endif
46
47 ifeq ($(CONFIG_VORBIS),yes)
48 OBJS+= ogg.o
49 endif
50
51 LIB= $(LIBPREF)avformat$(LIBSUF)
52
53 SRCS := $(OBJS:.o=.c)
54
55 all: $(LIB)
56
57 $(LIB): .depend $(OBJS)
58 rm -f $@
59 $(AR) rc $@ $(OBJS)
60 ifneq ($(CONFIG_OS2),yes)
61 $(RANLIB) $@
62 endif
63
64 .depend: $(SRCS)
65 $(CC) -MM $(CFLAGS) $^ 1>.depend
66
67 installlib: all
68 install -m 644 $(LIB) $(prefix)/lib
69 mkdir -p $(prefix)/include/ffmpeg
70 install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
71 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
72 $(SRC_PATH)/libavformat/rtspcodes.h \
73 $(prefix)/include/ffmpeg
74
75 %.o: %.c
76 $(CC) $(CFLAGS) -c -o $@ $<
77
78 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
79 %.o: %.cpp
80 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
81
82 clean:
83 rm -f *.o *.d .depend *~ *.a $(LIB)
84
85 #
86 # include dependency files if they exist
87 #
88 ifneq ($(wildcard .depend),)
89 include .depend
90 endif