regtest: split wma test into wmav1 and wmav2
[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
bde51e6a
JR
141SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
142
143CODEC_TESTS = $(addprefix regtest-, \
144 mpeg \
145 mpeg2 \
146 mpeg2thread \
147 msmpeg4v2 \
148 msmpeg4 \
149 wmv1 \
150 wmv2 \
151 h261 \
152 h263 \
153 h263p \
154 mpeg4 \
155 huffyuv \
156 rc \
157 mpeg4adv \
158 mpeg4thread \
159 error \
160 mpeg4nr \
161 mpeg1b \
162 mjpeg \
163 ljpeg \
164 jpegls \
165 rv10 \
166 rv20 \
167 asv1 \
168 asv2 \
169 flv \
170 ffv1 \
171 snow \
172 snowll \
173 dv \
174 dv50 \
96fdb624
MR
175 dnxhd_1080i \
176 dnxhd_720p \
177 dnxhd_720p_rd \
bde51e6a
JR
178 svq1 \
179 flashsv \
ae5e8caa 180 roq \
bde51e6a
JR
181 mp2 \
182 ac3 \
183 g726 \
184 adpcm_ima_wav \
185 adpcm_ima_qt \
186 adpcm_ms \
187 adpcm_yam \
188 adpcm_swf \
9797ce58 189 alac \
bde51e6a 190 flac \
4b294c18
MR
191 wmav1 \
192 wmav2 \
bde51e6a
JR
193 pcm \
194 )
195
196LAVF_TESTS = $(addprefix regtest-, \
197 avi \
198 asf \
199 rm \
200 mpg \
b686d0ab 201 mxf \
bde51e6a
JR
202 ts \
203 swf \
204 ffm \
205 flv_fmt \
206 mov \
207 dv_fmt \
208 gxf \
209 nut \
210 mkv \
211 pbmpipe \
212 pgmpipe \
213 ppmpipe \
214 gif \
215 yuv4mpeg \
216 pgm \
217 ppm \
218 bmp \
219 tga \
220 tiff \
221 sgi \
222 jpg \
223 wav \
224 alaw \
225 mulaw \
226 au \
227 mmf \
228 aiff \
229 voc \
230 ogg \
231 pixfmt \
effcedf7 232 pcx \
bde51e6a
JR
233 )
234
40e02409
SS
235LAVFI_TESTS = $(addprefix regtest-, \
236 )
237
20a93972
DB
238ifneq ($(CONFIG_ZLIB),yes)
239regtest-flashsv codectest: zlib-error
240endif
241zlib-error:
242 @echo
243 @echo "This regression test requires zlib."
244 @echo
245 @exit 1
246
eca478c3
MR
247codectest: $(CODEC_TESTS)
248lavftest: $(LAVF_TESTS)
bde51e6a 249
eca478c3 250# lavfitest: $(LAVFI_TESTS)
40e02409 251
eca478c3 252$(CODEC_TESTS) $(LAVF_TESTS) $(LAVFI_TESTS): regtest-ref
bde51e6a 253
eca478c3
MR
254REFFILE = $(SRC_PATH)/tests/ref/$(1)/$(2:regtest-%=%)
255RESFILE = tests/data/$(2:regtest-%=%).$(1).regression
bde51e6a 256
eca478c3
MR
257define CODECTEST_CMD
258 $(SRC_PATH)/tests/codec-regression.sh $@ vsynth1 tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
259 $(SRC_PATH)/tests/codec-regression.sh $@ vsynth2 tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
260endef
bde51e6a 261
d7167f05 262regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/data/asynth1.sw
eca478c3 263 $(CODECTEST_CMD)
bde51e6a 264
eca478c3
MR
265$(CODEC_TESTS): tests/tiny_psnr$(HOSTEXESUF)
266 @echo "TEST CODEC $(@:regtest-%=%)"
267 @$(CODECTEST_CMD)
268 @diff -u -w $(call REFFILE,vsynth1,$@) $(call RESFILE,vsynth1,$@)
269 @diff -u -w $(call REFFILE,vsynth2,$@) $(call RESFILE,vsynth2,$@)
bde51e6a
JR
270
271$(LAVF_TESTS):
eca478c3
MR
272 @echo "TEST LAVF $(@:regtest-%=%)"
273 @$(SRC_PATH)/tests/lavf-regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
274 @diff -u -w $(call REFFILE,lavf,$@) $(call RESFILE,lavf,$@)
bde51e6a 275
40e02409 276$(LAVFI_TESTS):
eca478c3
MR
277 @echo "TEST LAVFI $(@:regtest-%=%)"
278 @$(SRC_PATH)/tests/lavfi-regression.sh $@ lavfi tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
279 @diff -u -w $(call REFFILE,lavfi,$@) $(call RESFILE,lavfi,$@)
40e02409 280
1cde611d 281seektest: codectest lavftest tests/seek_test$(EXESUF)
62cb577e 282 $(SRC_PATH)/tests/seek-regression.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 283
d7167f05 284ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
bde51e6a
JR
285 @echo
286 @echo "Unfortunately ffserver is broken and therefore its regression"
287 @echo "test fails randomly. Treat the results accordingly."
288 @echo
767e14c3 289 $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
bde51e6a 290
82bb3329 291tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
bde51e6a
JR
292 mkdir -p tests/vsynth1
293 $(BUILD_ROOT)/$< 'tests/vsynth1/'
294
82bb3329 295tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
bde51e6a
JR
296 mkdir -p tests/vsynth2
297 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
298
d7167f05
DB
299tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
300 mkdir -p tests/data
bde51e6a
JR
301 $(BUILD_ROOT)/$< $@
302
684b28e0
MR
303tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
304 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
bde51e6a
JR
305
306
0c3b2d65 307.PHONY: documentation *test regtest-* zlib-error alltools check config