8db1c59127cd50a9e718dd9cb8006fee471a1393
[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)/libavutil -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 img2.o raw.o rm.o \
16 avienc.o avidec.o wav.o mmf.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 sol.o electronicarts.o nsvdec.o asf.o asf-enc.o \
20 ogg2.o oggparsevorbis.o oggparsetheora.o oggparseflac.o daud.o
21 AMROBJS=
22 ifeq ($(AMR_NB),yes)
23 AMROBJS= amr.o
24 endif
25 ifeq ($(AMR_NB_FIXED),yes)
26 AMROBJS= amr.o
27 endif
28 ifeq ($(AMR_WB),yes)
29 AMROBJS= amr.o
30 endif
31 OBJS+= $(AMROBJS)
32
33 # image formats
34 OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o
35 # file I/O
36 OBJS+= avio.o aviobuf.o file.o
37 OBJS+= framehook.o
38
39 ifeq ($(CONFIG_VIDEO4LINUX),yes)
40 OBJS+= grab.o
41 endif
42
43 ifeq ($(CONFIG_BKTR),yes)
44 OBJS+= grab_bktr.o
45 endif
46
47 ifeq ($(CONFIG_DV1394),yes)
48 OBJS+= dv1394.o
49 endif
50
51 ifeq ($(CONFIG_DC1394),yes)
52 OBJS+= dc1394.o
53 endif
54
55 ifeq ($(CONFIG_AUDIO_OSS),yes)
56 OBJS+= audio.o
57 endif
58
59 EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
60
61 ifeq ($(CONFIG_AUDIO_BEOS),yes)
62 PPOBJS+= beosaudio.o
63 endif
64
65 ifeq ($(CONFIG_NETWORK),yes)
66 OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
67 # BeOS and Darwin network stuff
68 ifeq ($(NEED_INET_ATON),yes)
69 OBJS+= barpainet.o
70 endif
71 endif
72
73 ifeq ($(CONFIG_LIBOGG),yes)
74 OBJS+= ogg.o
75 endif
76
77 ifeq ($(TARGET_ARCH_SPARC64),yes)
78 CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
79 endif
80
81 LIB= $(LIBPREF)avformat$(LIBSUF)
82 ifeq ($(BUILD_SHARED),yes)
83 LIBVERSION=$(LAVFMAJOR)
84 SLIBNAME= $(SLIBPREF)avformat$(SLIBSUF)
85 AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
86 endif
87
88 SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
89
90 all: $(LIB) $(SLIBNAME)
91
92 $(LIB): $(OBJS) $(PPOBJS)
93 rm -f $@
94 $(AR) rc $@ $(OBJS) $(PPOBJS)
95 $(RANLIB) $@
96
97 $(SLIBNAME): $(OBJS)
98 ifeq ($(CONFIG_WIN32),yes)
99 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
100 -lib /machine:i386 /def:$(@:.dll=.def)
101 else
102 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
103 endif
104
105 depend: $(SRCS)
106 $(CC) -MM $(CFLAGS) $^ 1>.depend
107
108 ifeq ($(BUILD_SHARED),yes)
109 install: all install-headers
110 ifeq ($(CONFIG_WIN32),yes)
111 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
112 else
113 install -d $(libdir)
114 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/$(SLIBPREF)avformat-$(VERSION)$(SLIBSUF)
115 ln -sf $(SLIBPREF)avformat-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
116 $(LDCONFIG) || true
117 endif
118 else
119 install:
120 endif
121
122 installlib: all install-headers
123 install -m 644 $(LIB) "$(libdir)"
124
125 install-headers:
126 mkdir -p "$(prefix)/include/ffmpeg"
127 install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
128 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
129 $(SRC_PATH)/libavformat/rtspcodes.h \
130 "$(prefix)/include/ffmpeg"
131 install -d "$(libdir)/pkgconfig"
132 install -m 644 ../libavformat.pc "$(libdir)/pkgconfig"
133
134 %.o: %.c
135 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
136
137 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
138 %.o: %.cpp
139 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
140
141 distclean clean:
142 rm -f *.o *.d .depend *~ *.a *$(SLIBSUF) $(LIB)
143
144 #
145 # include dependency files if they exist
146 #
147 ifneq ($(wildcard .depend),)
148 include .depend
149 endif