regtest: suppress console output from tests
[libav.git] / Makefile
CommitLineData
bde51e6a
JR
1include config.mak
2
3SRC_DIR = $(SRC_PATH_BARE)
4
5vpath %.texi $(SRC_PATH_BARE)
6
7PROGS-$(CONFIG_FFMPEG) += ffmpeg
8PROGS-$(CONFIG_FFPLAY) += ffplay
9PROGS-$(CONFIG_FFSERVER) += ffserver
10
00962aba 11PROGS := $(addsuffix $(EXESUF), $(PROGS-yes))
bde51e6a
JR
12PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
13OBJS = $(addsuffix .o, $(PROGS-yes)) cmdutils.o
14MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
94f3c0e5 15TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws pktdumper probetest qt-faststart trasher))
de4070b5 16HOSTPROGS = $(addprefix tests/, audiogen videogen rotozoom tiny_psnr)
bde51e6a
JR
17
18BASENAMES = ffmpeg ffplay ffserver
19ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
20ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
21ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
22
23FFLIBS-$(CONFIG_AVFILTER) += avfilter
24FFLIBS-$(CONFIG_POSTPROC) += postproc
bde51e6a 25
6d4f53cb 26FFLIBS := avdevice avformat avcodec avutil swscale
bde51e6a 27
a1a84f69
RS
28DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
29
bde51e6a
JR
30include common.mak
31
32FF_LDFLAGS := $(FFLDFLAGS)
33FF_EXTRALIBS := $(FFEXTRALIBS)
34FF_DEP_LIBS := $(DEP_LIBS)
35
c73f65d9 36ALL_TARGETS-$(CONFIG_DOC) += documentation
bde51e6a 37
a48289c7 38ifdef PROGS
a1a84f69 39INSTALL_TARGETS-yes += install-progs install-data
c73f65d9 40INSTALL_TARGETS-$(CONFIG_DOC) += install-man
bde51e6a 41endif
bea81a52 42INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
bde51e6a
JR
43
44all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
45
46$(PROGS): %$(EXESUF): %_g$(EXESUF)
47 cp -p $< $@
48 $(STRIP) $@
49
95f2c769 50SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
de4070b5
MR
51 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
52 HOSTPROGS
bde51e6a
JR
53
54define RESET
55$(1) :=
56$(1)-yes :=
57endef
58
59define DOSUBDIR
60$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
61SUBDIR := $(1)/
62include $(1)/Makefile
63endef
64
65$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
66
67ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
68ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
69
70%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
684b28e0 71 $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
bde51e6a 72
2dfa3054
MR
73tools/%$(EXESUF): tools/%.o
74 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
75
2205da0d 76tools/%.o: tools/%.c
2dfa3054 77 $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_O) $<
bde51e6a
JR
78
79ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
80
36798f1b
MR
81cmdutils.o cmdutils.d: version.h
82
13b1c80b 83alltools: $(TOOLS)
9bce82fa 84
15674f12
DB
85documentation: $(addprefix doc/, developer.html faq.html ffmpeg-doc.html \
86 ffplay-doc.html ffserver-doc.html \
dba755fa 87 general.html libavfilter.html $(ALLMANPAGES))
bde51e6a
JR
88
89doc/%.html: doc/%.texi
90 texi2html -monolithic -number $<
91 mv $(@F) $@
92
93doc/%.pod: doc/%-doc.texi
94 doc/texi2pod.pl $< $@
95
96doc/%.1: doc/%.pod
97 pod2man --section=1 --center=" " --release=" " $< > $@
98
99install: $(INSTALL_TARGETS-yes)
100
101install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
102 install -d "$(BINDIR)"
103 install -c -m 755 $(PROGS) "$(BINDIR)"
104
a1a84f69
RS
105install-data: $(DATA_FILES)
106 install -d "$(DATADIR)"
107 install -m 644 $(DATA_FILES) "$(DATADIR)"
108
bde51e6a
JR
109install-man: $(MANPAGES)
110 install -d "$(MANDIR)/man1"
111 install -m 644 $(MANPAGES) "$(MANDIR)/man1"
112
93fe7eb6
RP
113uninstall:
114 @echo "I'm sorry, Dave. I'm afraid I can't do that"
bde51e6a 115
250dd6f0 116testclean:
d7167f05 117 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/*~
250dd6f0
FC
118
119clean:: testclean
219a7185 120 rm -f $(ALLPROGS) $(ALLPROGS_G)
2b7a351e 121 rm -f $(CLEANSUFFIXES)
bde51e6a 122 rm -f doc/*.html doc/*.pod doc/*.1
4e67aedd 123 rm -f tests/seek_test$(EXESUF) tests/seek_test.o
82bb3329 124 rm -f $(addprefix tests/,$(addsuffix $(HOSTEXESUF),audiogen videogen rotozoom tiny_psnr))
13b1c80b 125 rm -f $(TOOLS)
bde51e6a
JR
126
127distclean::
2b7a351e 128 rm -f $(DISTCLEANSUFFIXES)
fdf11906 129 rm -f version.h config.*
bde51e6a 130
0c3b2d65
MR
131config:
132 $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
133
bde51e6a
JR
134# regression tests
135
5bab8536
DB
136check: test checkheaders
137
1cde611d 138fulltest test: codectest lavftest seektest
bde51e6a 139
bde51e6a 140FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
f1f66d3a 141LAVF_REFFILE = $(SRC_PATH)/tests/lavf.regression.ref
40e02409 142LAVFI_REFFILE = $(SRC_PATH)/tests/lavfi.regression.ref
bde51e6a
JR
143ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
144SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
97668ac7 145VSYNTH_REFFILE = $(SRC_PATH)/tests/vsynth.regression.ref
bde51e6a
JR
146
147CODEC_TESTS = $(addprefix regtest-, \
148 mpeg \
149 mpeg2 \
150 mpeg2thread \
151 msmpeg4v2 \
152 msmpeg4 \
153 wmv1 \
154 wmv2 \
155 h261 \
156 h263 \
157 h263p \
158 mpeg4 \
159 huffyuv \
160 rc \
161 mpeg4adv \
162 mpeg4thread \
163 error \
164 mpeg4nr \
165 mpeg1b \
166 mjpeg \
167 ljpeg \
168 jpegls \
169 rv10 \
170 rv20 \
171 asv1 \
172 asv2 \
173 flv \
174 ffv1 \
175 snow \
176 snowll \
177 dv \
178 dv50 \
96fdb624
MR
179 dnxhd_1080i \
180 dnxhd_720p \
181 dnxhd_720p_rd \
bde51e6a
JR
182 svq1 \
183 flashsv \
ae5e8caa 184 roq \
bde51e6a
JR
185 mp2 \
186 ac3 \
187 g726 \
188 adpcm_ima_wav \
189 adpcm_ima_qt \
190 adpcm_ms \
191 adpcm_yam \
192 adpcm_swf \
9797ce58 193 alac \
bde51e6a
JR
194 flac \
195 wma \
196 pcm \
197 )
198
199LAVF_TESTS = $(addprefix regtest-, \
200 avi \
201 asf \
202 rm \
203 mpg \
b686d0ab 204 mxf \
bde51e6a
JR
205 ts \
206 swf \
207 ffm \
208 flv_fmt \
209 mov \
210 dv_fmt \
211 gxf \
212 nut \
213 mkv \
214 pbmpipe \
215 pgmpipe \
216 ppmpipe \
217 gif \
218 yuv4mpeg \
219 pgm \
220 ppm \
221 bmp \
222 tga \
223 tiff \
224 sgi \
225 jpg \
226 wav \
227 alaw \
228 mulaw \
229 au \
230 mmf \
231 aiff \
232 voc \
233 ogg \
234 pixfmt \
effcedf7 235 pcx \
bde51e6a
JR
236 )
237
40e02409
SS
238LAVFI_TESTS = $(addprefix regtest-, \
239 )
240
2795e357 241RESFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
bde51e6a 242
2795e357
SS
243ROTOZOOM_RESFILES = $(call RESFILES,rotozoom.regression,$(CODEC_TESTS))
244VSYNTH_RESFILES = $(call RESFILES,vsynth.regression,$(CODEC_TESTS))
bde51e6a 245
2795e357 246LAVF_RESFILES = $(call RESFILES,lavf.regression,$(LAVF_TESTS))
40e02409 247LAVFI_RESFILES = $(call RESFILES,lavfi.regression,$(LAVFI_TESTS))
bde51e6a 248
2795e357 249LAVF_RESFILE = tests/data/lavf.regression
40e02409 250LAVFI_RESFILE = tests/data/lavfi.regression
2795e357
SS
251ROTOZOOM_RESFILE = tests/data/rotozoom.regression
252VSYNTH_RESFILE = tests/data/vsynth.regression
bde51e6a 253
20a93972
DB
254ifneq ($(CONFIG_ZLIB),yes)
255regtest-flashsv codectest: zlib-error
256endif
257zlib-error:
258 @echo
259 @echo "This regression test requires zlib."
260 @echo
261 @exit 1
262
2795e357
SS
263codectest: $(VSYNTH_RESFILE) $(ROTOZOOM_RESFILE)
264 diff -u -w $(VSYNTH_REFFILE) $(VSYNTH_RESFILE)
265 diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_RESFILE)
bde51e6a 266
2795e357
SS
267lavftest: $(LAVF_RESFILE)
268 diff -u -w $(LAVF_REFFILE) $(LAVF_RESFILE)
bde51e6a 269
40e02409
SS
270# lavfitest: $(LAVFI_RESFILE)
271# diff -u -w $(LAVFI_REFFILE) $(LAVFI_RESFILE)
272
273$(VSYNTH_RESFILE) $(ROTOZOOM_RESFILE) $(LAVF_RESFILE) $(LAVFI_RESFILE):
bde51e6a
JR
274 cat $^ > $@
275
2795e357 276$(LAVF_RESFILE): $(LAVF_RESFILES)
40e02409 277$(LAVFI_RESFILE): $(LAVFI_RESFILES)
2795e357
SS
278$(ROTOZOOM_RESFILE): $(ROTOZOOM_RESFILES)
279$(VSYNTH_RESFILE): $(VSYNTH_RESFILES)
bde51e6a 280
2795e357 281$(VSYNTH_RESFILES) $(ROTOZOOM_RESFILES): $(CODEC_TESTS)
bde51e6a 282
2795e357 283$(LAVF_RESFILES): $(LAVF_TESTS)
40e02409 284$(LAVFI_RESFILES): $(LAVFI_TESTS)
bde51e6a 285
40e02409 286$(CODEC_TESTS) $(LAVF_TESTS) $(LAVFI_TESTS): regtest-ref
bde51e6a 287
d7167f05 288regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/data/asynth1.sw
bde51e6a 289
82bb3329 290$(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(HOSTEXESUF)
6117ffbe
DB
291 $(SRC_PATH)/tests/codec-regression.sh $@ vsynth tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
292 $(SRC_PATH)/tests/codec-regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a
JR
293
294$(LAVF_TESTS):
8f1e4d4f 295 $(SRC_PATH)/tests/lavf-regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 296
40e02409 297$(LAVFI_TESTS):
77f66963 298 $(SRC_PATH)/tests/lavfi-regression.sh $@ lavfi tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
40e02409 299
1cde611d 300seektest: codectest lavftest tests/seek_test$(EXESUF)
62cb577e 301 $(SRC_PATH)/tests/seek-regression.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 302
d7167f05 303ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
bde51e6a
JR
304 @echo
305 @echo "Unfortunately ffserver is broken and therefore its regression"
306 @echo "test fails randomly. Treat the results accordingly."
307 @echo
767e14c3 308 $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
bde51e6a 309
82bb3329 310tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
bde51e6a
JR
311 mkdir -p tests/vsynth1
312 $(BUILD_ROOT)/$< 'tests/vsynth1/'
313
82bb3329 314tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
bde51e6a
JR
315 mkdir -p tests/vsynth2
316 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
317
d7167f05
DB
318tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
319 mkdir -p tests/data
bde51e6a
JR
320 $(BUILD_ROOT)/$< $@
321
684b28e0
MR
322tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
323 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
bde51e6a
JR
324
325
0c3b2d65 326.PHONY: documentation *test regtest-* zlib-error alltools check config