Add size that is needed for the wmapro codec
[FFMpeg-mirror/ordered_chapters.git] / Makefile
blob2c94537f73f221c21ae1a0f88593e5fbe651ec24
1 include config.mak
3 SRC_DIR = $(SRC_PATH_BARE)
5 vpath %.texi $(SRC_PATH_BARE)
7 PROGS-$(CONFIG_FFMPEG) += ffmpeg
8 PROGS-$(CONFIG_FFPLAY) += ffplay
9 PROGS-$(CONFIG_FFSERVER) += ffserver
11 PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
12 PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
13 OBJS = $(addsuffix .o, $(PROGS-yes)) cmdutils.o
14 MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
16 BASENAMES = ffmpeg ffplay ffserver
17 ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
18 ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
19 ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
21 FFLIBS-$(CONFIG_AVFILTER) += avfilter
22 FFLIBS-$(CONFIG_POSTPROC) += postproc
23 FFLIBS-$(CONFIG_SWSCALE) += swscale
25 FFLIBS := avdevice avformat avcodec avutil
27 include common.mak
29 FF_LDFLAGS := $(FFLDFLAGS)
30 FF_EXTRALIBS := $(FFEXTRALIBS)
31 FF_DEP_LIBS := $(DEP_LIBS)
33 ALL_TARGETS-$(CONFIG_VHOOK) += videohook
34 ALL_TARGETS-$(BUILD_DOC) += documentation
36 INSTALL_TARGETS-$(CONFIG_VHOOK) += install-vhook
37 ifneq ($(PROGS),)
38 INSTALL_TARGETS-yes += install-progs
39 INSTALL_TARGETS-$(BUILD_DOC) += install-man
40 endif
41 INSTALL_PROGS_TARGETS-$(BUILD_SHARED) = install-libs
43 all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
45 $(PROGS): %$(EXESUF): %_g$(EXESUF)
46 cp -p $< $@
47 $(STRIP) $@
49 SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTS
51 define RESET
52 $(1) :=
53 $(1)-yes :=
54 endef
56 define DOSUBDIR
57 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
58 SUBDIR := $(1)/
59 include $(1)/Makefile
60 endef
62 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
64 ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
65 ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
67 %_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
68 $(CC) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
70 output_example$(EXESUF): output_example.o $(FF_DEP_LIBS)
71 $(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
73 tools/%$(EXESUF): tools/%.c
74 $(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
76 ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
78 alltools: $(addsuffix $(EXESUF),$(addprefix tools/, cws2fws pktdumper qt-faststart trasher))
80 VHOOKCFLAGS += $(filter-out -mdynamic-no-pic,$(CFLAGS))
82 BASEHOOKS = fish null watermark
83 ALLHOOKS = $(BASEHOOKS) drawtext imlib2 ppm
84 ALLHOOKS_SRCS = $(addprefix vhook/, $(addsuffix .c, $(ALLHOOKS)))
86 HOOKS-$(HAVE_FORK) += ppm
87 HOOKS-$(HAVE_IMLIB2) += imlib2
88 HOOKS-$(HAVE_FREETYPE2) += drawtext
90 HOOKS = $(addprefix vhook/, $(addsuffix $(SLIBSUF), $(BASEHOOKS) $(HOOKS-yes)))
92 VHOOKCFLAGS-$(HAVE_IMLIB2) += `imlib2-config --cflags`
93 LIBS_imlib2$(SLIBSUF) = `imlib2-config --libs`
95 VHOOKCFLAGS-$(HAVE_FREETYPE2) += `freetype-config --cflags`
96 LIBS_drawtext$(SLIBSUF) = `freetype-config --libs`
98 VHOOKCFLAGS += $(VHOOKCFLAGS-yes)
100 vhook/%.o vhook/%.d: CFLAGS:=$(VHOOKCFLAGS)
102 # vhooks compile fine without libav*, but need them nonetheless.
103 videohook: $(FF_DEP_LIBS) $(HOOKS)
105 $(eval VHOOKSHFLAGS=$(VHOOKSHFLAGS))
106 vhook/%$(SLIBSUF): vhook/%.o
107 $(CC) $(LDFLAGS) -o $@ $(VHOOKSHFLAGS) $< $(VHOOKLIBS) $(LIBS_$(@F))
109 VHOOK_DEPS = $(HOOKS:$(SLIBSUF)=.d)
110 depend dep: $(VHOOK_DEPS)
112 documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
113 ffplay-doc.html general.html hooks.html \
114 $(ALLMANPAGES))
116 doc/%.html: doc/%.texi
117 texi2html -monolithic -number $<
118 mv $(@F) $@
120 doc/%.pod: doc/%-doc.texi
121 doc/texi2pod.pl $< $@
123 doc/%.1: doc/%.pod
124 pod2man --section=1 --center=" " --release=" " $< > $@
126 install: $(INSTALL_TARGETS-yes)
128 install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
129 install -d "$(BINDIR)"
130 install -c -m 755 $(PROGS) "$(BINDIR)"
132 install-man: $(MANPAGES)
133 install -d "$(MANDIR)/man1"
134 install -m 644 $(MANPAGES) "$(MANDIR)/man1"
136 install-vhook: videohook
137 install -d "$(SHLIBDIR)/vhook"
138 install -m 755 $(HOOKS) "$(SHLIBDIR)/vhook"
140 uninstall: uninstall-progs uninstall-man uninstall-vhook
142 uninstall-progs:
143 rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
145 uninstall-man:
146 rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
148 uninstall-vhook:
149 rm -f $(addprefix "$(SHLIBDIR)/",$(ALLHOOKS_SRCS:.c=$(SLIBSUF)))
150 -rmdir "$(SHLIBDIR)/vhook/"
152 testclean:
153 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
155 clean:: testclean
156 rm -f $(ALLPROGS) $(ALLPROGS_G) output_example$(EXESUF)
157 rm -f doc/*.html doc/*.pod doc/*.1
158 rm -f $(addprefix tests/,$(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr))
159 rm -f $(addprefix tools/,$(addsuffix $(EXESUF),cws2fws pktdumper qt-faststart trasher))
160 rm -f vhook/*.o vhook/*~ vhook/*.so vhook/*.dylib vhook/*.dll
162 distclean::
163 rm -f version.h config.* vhook/*.d
165 # regression tests
167 check: test checkheaders
169 fulltest test: codectest libavtest seektest
171 FFMPEG_REFFILE = $(SRC_PATH)/tests/ffmpeg.regression.ref
172 FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
173 LIBAV_REFFILE = $(SRC_PATH)/tests/libav.regression.ref
174 ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
175 SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
177 CODEC_TESTS = $(addprefix regtest-, \
178 mpeg \
179 mpeg2 \
180 mpeg2thread \
181 msmpeg4v2 \
182 msmpeg4 \
183 wmv1 \
184 wmv2 \
185 h261 \
186 h263 \
187 h263p \
188 mpeg4 \
189 huffyuv \
190 rc \
191 mpeg4adv \
192 mpeg4thread \
193 error \
194 mpeg4nr \
195 mpeg1b \
196 mjpeg \
197 ljpeg \
198 jpegls \
199 rv10 \
200 rv20 \
201 asv1 \
202 asv2 \
203 flv \
204 ffv1 \
205 snow \
206 snowll \
207 dv \
208 dv50 \
209 svq1 \
210 flashsv \
211 mp2 \
212 ac3 \
213 g726 \
214 adpcm_ima_wav \
215 adpcm_ima_qt \
216 adpcm_ms \
217 adpcm_yam \
218 adpcm_swf \
219 flac \
220 wma \
221 pcm \
224 LAVF_TESTS = $(addprefix regtest-, \
225 avi \
226 asf \
227 rm \
228 mpg \
229 ts \
230 swf \
231 ffm \
232 flv_fmt \
233 mov \
234 dv_fmt \
235 gxf \
236 nut \
237 mkv \
238 pbmpipe \
239 pgmpipe \
240 ppmpipe \
241 gif \
242 yuv4mpeg \
243 pgm \
244 ppm \
245 bmp \
246 tga \
247 tiff \
248 sgi \
249 jpg \
250 wav \
251 alaw \
252 mulaw \
253 au \
254 mmf \
255 aiff \
256 voc \
257 ogg \
258 pixfmt \
261 REGFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
263 CODEC_ROTOZOOM = $(call REGFILES,rotozoom.regression,$(CODEC_TESTS))
264 CODEC_VSYNTH = $(call REGFILES,vsynth.regression,$(CODEC_TESTS))
266 LAVF_REGFILES = $(call REGFILES,lavf.regression,$(LAVF_TESTS))
268 LAVF_REG = tests/data/lavf.regression
269 ROTOZOOM_REG = tests/data/rotozoom.regression
270 VSYNTH_REG = tests/data/vsynth.regression
272 ifneq ($(CONFIG_SWSCALE),yes)
273 servertest codectest $(CODEC_TESTS) libavtest: swscale_error
274 swscale_error:
275 @echo
276 @echo "This regression test requires --enable-swscale."
277 @echo
278 @exit 1
279 endif
281 codectest: $(VSYNTH_REG) $(ROTOZOOM_REG)
282 diff -u -w $(FFMPEG_REFFILE) $(VSYNTH_REG)
283 diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_REG)
285 libavtest: $(LAVF_REG)
286 diff -u -w $(LIBAV_REFFILE) $(LAVF_REG)
288 $(VSYNTH_REG) $(ROTOZOOM_REG) $(LAVF_REG):
289 cat $^ > $@
291 $(LAVF_REG): $(LAVF_REGFILES)
292 $(ROTOZOOM_REG): $(CODEC_ROTOZOOM)
293 $(VSYNTH_REG): $(CODEC_VSYNTH)
295 $(CODEC_VSYNTH) $(CODEC_ROTOZOOM): $(CODEC_TESTS)
297 $(LAVF_REGFILES): $(LAVF_TESTS)
299 $(CODEC_TESTS) $(LAVF_TESTS): regtest-ref
301 regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/asynth1.sw
303 $(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(EXESUF)
304 $(SRC_PATH)/tests/regression.sh $@ vsynth tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
305 $(SRC_PATH)/tests/regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
307 $(LAVF_TESTS):
308 $(SRC_PATH)/tests/regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
310 seektest: codectest libavtest tests/seek_test$(EXESUF)
311 $(SRC_PATH)/tests/seek_test.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
313 servertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
314 @echo
315 @echo "Unfortunately ffserver is broken and therefore its regression"
316 @echo "test fails randomly. Treat the results accordingly."
317 @echo
318 $(SRC_PATH)/tests/server-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/test.conf
320 tests/vsynth1/00.pgm: tests/videogen$(EXESUF)
321 mkdir -p tests/vsynth1
322 $(BUILD_ROOT)/$< 'tests/vsynth1/'
324 tests/vsynth2/00.pgm: tests/rotozoom$(EXESUF)
325 mkdir -p tests/vsynth2
326 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
328 tests/asynth1.sw: tests/audiogen$(EXESUF)
329 $(BUILD_ROOT)/$< $@
331 tests/%$(EXESUF): tests/%.c
332 $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
334 tests/seek_test$(EXESUF): tests/seek_test.c $(FF_DEP_LIBS)
335 $(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $< $(FF_EXTRALIBS)
338 .PHONY: lib videohook documentation *test regtest-* swscale-error alltools check
340 -include $(VHOOK_DEPS)