changes some function declarations from () to (void) as per ansi c.
[libav.git] / Makefile
1 #
2 # Main ffmpeg Makefile
3 # (c) 2000-2004 Fabrice Bellard
4 #
5 include config.mak
6
7 VPATH=$(SRC_PATH_BARE)
8
9 CFLAGS=$(OPTFLAGS) -I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
10 -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libswscale \
11 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
12 LDFLAGS+= -g
13
14 PROGS-$(CONFIG_FFMPEG) += ffmpeg
15 PROGS-$(CONFIG_FFPLAY) += ffplay
16 PROGS-$(CONFIG_FFSERVER) += ffserver
17
18 PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
19 PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
20 MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
21
22 BASENAMES=ffmpeg ffplay ffserver
23 ALLPROGS=$(addsuffix $(EXESUF), $(BASENAMES))
24 ALLPROGS_G=$(addsuffix _g$(EXESUF), $(BASENAMES))
25 ALLMANPAGES=$(addsuffix .1, $(BASENAMES))
26
27 ifeq ($(BUILD_SHARED),yes)
28 DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
29 else
30 DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
31 endif
32
33 ifeq ($(CONFIG_VHOOK),yes)
34 all: videohook
35 install: install-vhook
36 endif
37
38 ifeq ($(BUILD_DOC),yes)
39 all: documentation
40 install: install-man
41 endif
42
43 SRCS = $(addsuffix .c, $(PROGS-yes)) cmdutils.c
44 LDFLAGS := -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil $(LDFLAGS)
45 EXTRALIBS := -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
46
47 ifeq ($(CONFIG_SWSCALER),yes)
48 LDFLAGS+=-L./libswscale
49 EXTRALIBS+=-lswscale$(BUILDSUF)
50 endif
51
52 all: lib $(PROGS)
53
54 lib:
55 $(MAKE) -C libavutil all
56 $(MAKE) -C libavcodec all
57 $(MAKE) -C libavformat all
58 ifeq ($(CONFIG_PP),yes)
59 $(MAKE) -C libpostproc all
60 endif
61 ifeq ($(CONFIG_SWSCALER),yes)
62 $(MAKE) -C libswscale all
63 endif
64
65 ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
66 $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(EXTRALIBS)
67
68 ffserver$(EXESUF): ffserver.o .libs
69 $(CC) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ ffserver.o $(EXTRALIBS)
70
71 ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
72 $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(EXTRALIBS) $(SDL_LIBS)
73
74 %$(EXESUF): %_g$(EXESUF)
75 cp -p $< $@
76 $(STRIP) $@
77
78 SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
79 ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
80 version.h: $(SVN_ENTRIES)
81 endif
82
83 version.h:
84 $(SRC_PATH)/version.sh $(SRC_PATH)
85
86 output_example$(EXESUF): output_example.o .libs
87 $(CC) $(LDFLAGS) -o $@ output_example.o $(EXTRALIBS)
88
89 qt-faststart$(EXESUF): qt-faststart.c
90 $(CC) $(CFLAGS) $< -o $@
91
92 cws2fws$(EXESUF): cws2fws.c
93 $(CC) $< -o $@ -lz
94
95 ffplay.o: ffplay.c
96 $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
97
98 ffmpeg.o ffplay.o ffserver.o: version.h
99
100 %.o: %.c
101 $(CC) $(CFLAGS) -c -o $@ $<
102
103 videohook: .libs
104 $(MAKE) -C vhook all
105
106 documentation:
107 $(MAKE) -C doc all
108
109 install: install-progs install-libs install-headers
110
111 ifeq ($(BUILD_SHARED),yes)
112 install-progs: $(PROGS) install-libs
113 else
114 install-progs: $(PROGS)
115 endif
116 install -d "$(bindir)"
117 install -c -m 755 $(PROGS) "$(bindir)"
118
119 # Create the Windows installer.
120 wininstaller: all install
121 makensis ffinstall.nsi
122
123 install-man:
124 install -d "$(mandir)/man1"
125 install -m 644 $(MANPAGES) "$(mandir)/man1"
126
127 install-vhook:
128 $(MAKE) -C vhook install
129
130 install-libs:
131 $(MAKE) -C libavutil install-libs
132 $(MAKE) -C libavcodec install-libs
133 $(MAKE) -C libavformat install-libs
134 ifeq ($(CONFIG_PP),yes)
135 $(MAKE) -C libpostproc install-libs
136 endif
137 ifeq ($(CONFIG_SWSCALER),yes)
138 $(MAKE) -C libswscale install-libs
139 endif
140
141 ifeq ($(BUILD_SHARED),yes)
142 -$(LDCONFIG)
143 endif
144
145 install-headers:
146 $(MAKE) -C libavutil install-headers
147 $(MAKE) -C libavcodec install-headers
148 $(MAKE) -C libavformat install-headers
149 ifeq ($(CONFIG_PP),yes)
150 $(MAKE) -C libpostproc install-headers
151 endif
152 $(MAKE) -C libswscale install-headers
153
154 uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
155
156 uninstall-progs:
157 rm -f $(addprefix $(bindir)/, $(ALLPROGS))
158
159 uninstall-man:
160 rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
161
162 uninstall-vhook:
163 $(MAKE) -C vhook uninstall
164
165 uninstall-libs:
166 $(MAKE) -C libavutil uninstall-libs
167 $(MAKE) -C libavcodec uninstall-libs
168 $(MAKE) -C libavformat uninstall-libs
169 $(MAKE) -C libpostproc uninstall-libs
170
171 uninstall-headers:
172 $(MAKE) -C libavutil uninstall-headers
173 $(MAKE) -C libavcodec uninstall-headers
174 $(MAKE) -C libavformat uninstall-headers
175 $(MAKE) -C libpostproc uninstall-headers
176 -rmdir "$(incdir)"
177 -rmdir "$(prefix)/include/postproc"
178
179 depend dep: .depend
180 $(MAKE) -C libavutil depend
181 $(MAKE) -C libavcodec depend
182 $(MAKE) -C libavformat depend
183 ifeq ($(CONFIG_PP),yes)
184 $(MAKE) -C libpostproc depend
185 endif
186 ifeq ($(CONFIG_SWSCALER),yes)
187 $(MAKE) -C libswscale depend
188 endif
189 ifeq ($(CONFIG_VHOOK),yes)
190 $(MAKE) -C vhook depend
191 endif
192
193 .depend: $(SRCS) version.h
194 $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(filter-out %.h,$^) 1>.depend
195
196 $(DEP_LIBS): lib
197
198 .libs: $(DEP_LIBS)
199 touch $@
200
201 clean:
202 $(MAKE) -C libavutil clean
203 $(MAKE) -C libavcodec clean
204 $(MAKE) -C libavformat clean
205 $(MAKE) -C libpostproc clean
206 $(MAKE) -C libswscale clean
207 $(MAKE) -C tests clean
208 $(MAKE) -C vhook clean
209 $(MAKE) -C doc clean
210 rm -f *.o *.d *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
211 output_example$(EXESUF) qt-faststart$(EXESUF) cws2fws$(EXESUF)
212
213 distclean: clean
214 $(MAKE) -C libavutil distclean
215 $(MAKE) -C libavcodec distclean
216 $(MAKE) -C libavformat distclean
217 $(MAKE) -C libpostproc distclean
218 $(MAKE) -C libswscale distclean
219 $(MAKE) -C tests distclean
220 $(MAKE) -C vhook distclean
221 rm -f .depend version.h config.* *.pc
222
223 TAGS:
224 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
225
226 # regression tests
227
228 codectest libavtest test-server fulltest test mpeg4 mpeg: $(PROGS)
229 $(MAKE) -C tests $@
230
231 .PHONY: all lib videohook documentation install* wininstaller uninstall*
232 .PHONY: dep depend clean distclean TAGS
233 .PHONY: codectest libavtest test-server fulltest test mpeg4 mpeg
234
235 -include .depend