added SGI image format, encoding and decoding, courtesy of Todd Kirby
[libav.git] / libavformat / Makefile
1 #
2 # libavformat Makefile
3 # (c) 2000-2003 Fabrice Bellard
4 #
5 include ../config.mak
6
7 VPATH=$(SRC_PATH)/libavformat
8
9 CFLAGS=$(OPTFLAGS) -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 os_support.o allformats.o
12 PPOBJS=
13
14 # mux and demuxes
15 OBJS+=mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.o raw.o rm.o \
16 avienc.o avidec.o wav.o swf.o au.o gif.o mov.o mpjpeg.o dv.o \
17 yuv4mpeg.o 4xm.o flvenc.o flvdec.o movenc.o psxstr.o idroq.o ipmovie.o \
18 nut.o wc3movie.o mp3.o westwood.o segafilm.o idcin.o flic.o \
19 sierravmd.o matroska.o
20
21 ifeq ($(CONFIG_RISKY),yes)
22 OBJS+= asf.o
23 OBJS+= asf-enc.o
24 endif
25
26 ifeq ($(AMR_NB),yes)
27 OBJS+= amr.o
28 endif
29 ifeq ($(AMR_NB_FIXED),yes)
30 OBJS+= amr.o
31 endif
32 ifeq ($(AMR_WB),yes)
33 OBJS+= amr.o
34 endif
35
36 # image formats
37 OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o
38 # file I/O
39 OBJS+= avio.o aviobuf.o file.o
40 OBJS+= framehook.o
41
42 ifeq ($(CONFIG_VIDEO4LINUX),yes)
43 OBJS+= grab.o
44 endif
45
46 ifeq ($(CONFIG_DV1394),yes)
47 OBJS+= dv1394.o
48 endif
49
50 ifeq ($(CONFIG_AUDIO_OSS),yes)
51 OBJS+= audio.o
52 endif
53
54 ifeq ($(CONFIG_AUDIO_BEOS),yes)
55 PPOBJS+= beosaudio.o
56 EXTRALIBS+=-lbe -lmedia
57 # this should be the default !
58 EXTRALIBS+=-lavcodec -L../libavcodec
59 endif
60
61 ifeq ($(CONFIG_NETWORK),yes)
62 OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
63 # BeOS and Darwin network stuff
64 ifeq ($(NEED_INET_ATON),yes)
65 OBJS+= barpainet.o
66 endif
67 endif
68
69 ifeq ($(CONFIG_VORBIS),yes)
70 OBJS+= ogg.o
71 endif
72
73 LIB= $(LIBPREF)avformat$(LIBSUF)
74 ifeq ($(BUILD_SHARED),yes)
75 SLIB= $(SLIBPREF)avformat$(SLIBSUF)
76 endif
77
78 SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
79
80 all: $(LIB) $(SLIB)
81
82 $(LIB): $(OBJS) $(PPOBJS)
83 rm -f $@
84 $(AR) rc $@ $(OBJS) $(PPOBJS)
85 $(RANLIB) $@
86
87 $(SLIB): $(OBJS)
88 ifeq ($(CONFIG_WIN32),yes)
89 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(VPATH)/../libavcodec/avcodec.dll
90 -lib /machine:i386 /def:$(@:.dll=.def)
91 else
92 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS)
93 endif
94
95 depend: $(SRCS)
96 $(CC) -MM $(CFLAGS) $^ 1>.depend
97
98 ifeq ($(BUILD_SHARED),yes)
99 install: all install-headers
100 ifeq ($(CONFIG_WIN32),yes)
101 install -s -m 755 $(SLIB) "$(prefix)"
102 else
103 install -d $(prefix)/lib
104 install -s -m 755 $(SLIB) $(prefix)/lib/libavformat-$(VERSION).so
105 ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so
106 ldconfig || true
107 endif
108 else
109 install:
110 endif
111
112 installlib: all install-headers
113 install -m 644 $(LIB) $(prefix)/lib
114
115 install-headers:
116 mkdir -p "$(prefix)/include/ffmpeg"
117 install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
118 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
119 $(SRC_PATH)/libavformat/rtspcodes.h \
120 "$(prefix)/include/ffmpeg"
121
122 %.o: %.c
123 $(CC) $(CFLAGS) -c -o $@ $<
124
125 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
126 %.o: %.cpp
127 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
128
129 clean:
130 rm -f *.o *.d .depend *~ *.a $(LIB)
131
132 #
133 # include dependency files if they exist
134 #
135 ifneq ($(wildcard .depend),)
136 include .depend
137 endif