Fix qtrle regression test, actually test qtrle.
[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
336ce917 9PROGS-$(CONFIG_FFPROBE) += ffprobe
bde51e6a
JR
10PROGS-$(CONFIG_FFSERVER) += ffserver
11
583fcb52
MR
12PROGS := $(PROGS-yes:%=%$(EXESUF))
13PROGS_G = $(PROGS-yes:%=%_g$(EXESUF))
14OBJS = $(PROGS-yes:%=%.o) cmdutils.o
15MANPAGES = $(PROGS-yes:%=doc/%.1)
16PODPAGES = $(PROGS-yes:%=doc/%.pod)
17HTMLPAGES = $(PROGS-yes:%=doc/%.html)
94f3c0e5 18TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws pktdumper probetest qt-faststart trasher))
3d157bf3
MR
19TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
20HOSTPROGS := $(TESTTOOLS:%=tests/%)
bde51e6a 21
336ce917 22BASENAMES = ffmpeg ffplay ffprobe ffserver
583fcb52 23ALLPROGS = $(BASENAMES:%=%$(EXESUF))
3adbe49f 24ALLPROGS_G = $(BASENAMES:%=%_g$(EXESUF))
583fcb52 25ALLMANPAGES = $(BASENAMES:%=%.1)
bde51e6a 26
5a0f7131 27FFLIBS-$(CONFIG_AVDEVICE) += avdevice
bde51e6a 28FFLIBS-$(CONFIG_AVFILTER) += avfilter
5a0f7131 29FFLIBS-$(CONFIG_AVFORMAT) += avformat
97d5fa38 30FFLIBS-$(CONFIG_AVCODEC) += avcodec
bde51e6a 31FFLIBS-$(CONFIG_POSTPROC) += postproc
5a0f7131 32FFLIBS-$(CONFIG_SWSCALE) += swscale
aac6ca69 33FFLIBS-$(CONFIG_AVCORE) += avcore
bde51e6a 34
5a0f7131 35FFLIBS := avutil
bde51e6a 36
a1a84f69
RS
37DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
38
9b55e2e7
MR
39SKIPHEADERS = cmdutils_common_opts.h
40
bde51e6a
JR
41include common.mak
42
43FF_LDFLAGS := $(FFLDFLAGS)
44FF_EXTRALIBS := $(FFEXTRALIBS)
45FF_DEP_LIBS := $(DEP_LIBS)
46
c73f65d9 47ALL_TARGETS-$(CONFIG_DOC) += documentation
bde51e6a 48
a48289c7 49ifdef PROGS
a1a84f69 50INSTALL_TARGETS-yes += install-progs install-data
c73f65d9 51INSTALL_TARGETS-$(CONFIG_DOC) += install-man
bde51e6a 52endif
bea81a52 53INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
bde51e6a
JR
54
55all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
56
57$(PROGS): %$(EXESUF): %_g$(EXESUF)
4335125c 58 $(CP) $< $@
bde51e6a
JR
59 $(STRIP) $@
60
86601915
MR
61config.h: .config
62.config: $(wildcard $(FFLIBS:%=$(SRC_DIR)/lib%/all*.c))
9d0b3042
MR
63 @-tput bold 2>/dev/null
64 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
65 @-tput sgr0 2>/dev/null
86601915 66
95f2c769 67SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
de4070b5 68 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
a7878c9f 69 HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS
bde51e6a
JR
70
71define RESET
72$(1) :=
73$(1)-yes :=
74endef
75
76define DOSUBDIR
77$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
78SUBDIR := $(1)/
79include $(1)/Makefile
80endef
81
82$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
83
84ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
85ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
86
87%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
684b28e0 88 $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
bde51e6a 89
2dfa3054
MR
90tools/%$(EXESUF): tools/%.o
91 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
92
2205da0d 93tools/%.o: tools/%.c
4d1156cb 94 $(CC) $(CPPFLAGS) $(CFLAGS) -c $(CC_O) $<
bde51e6a 95
3123823c 96ffplay.o: CFLAGS += $(SDL_CFLAGS)
bde51e6a 97
6a53fffd 98VERSION_SH = $(SRC_PATH_BARE)/version.sh
f82bf850 99GIT_LOG = $(SRC_PATH_BARE)/.git/logs/HEAD
6a53fffd
MR
100SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
101
f82bf850 102.version: $(wildcard $(GIT_LOG) $(SVN_ENTRIES)) $(VERSION_SH) config.mak
6a53fffd
MR
103.version: M=@
104
105version.h .version:
0853a2b4 106 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
6a53fffd
MR
107 $(Q)touch .version
108
109# force version.sh to run whenever version might have changed
110-include .version
36798f1b 111
13b1c80b 112alltools: $(TOOLS)
9bce82fa 113
7f939f55 114DOCS = $(addprefix doc/, developer.html faq.html general.html libavfilter.html) $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
dd46b538 115
a0f9c8ce 116documentation: $(DOCS)
bde51e6a 117
a0f9c8ce
MR
118-include $(wildcard $(DOCS:%=%.d))
119
120TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
3275ac6a 121
7732f641 122doc/%.html: TAG = HTML
a8f0814a 123doc/%.html: doc/%.texi $(SRC_PATH_BARE)/doc/t2h.init
a0f9c8ce 124 $(Q)$(TEXIDEP)
a8f0814a 125 $(M)cd doc && texi2html -monolithic --init-file $(SRC_PATH_BARE)/doc/t2h.init $(<:doc/%=%)
bde51e6a 126
7732f641 127doc/%.pod: TAG = POD
82ccbe6b 128doc/%.pod: doc/%.texi
a0f9c8ce 129 $(Q)$(TEXIDEP)
86be2bc3 130 $(M)doc/texi2pod.pl $< $@
bde51e6a 131
7732f641 132doc/%.1: TAG = MAN
bde51e6a 133doc/%.1: doc/%.pod
86be2bc3 134 $(M)pod2man --section=1 --center=" " --release=" " $< > $@
bde51e6a
JR
135
136install: $(INSTALL_TARGETS-yes)
137
138install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
63611f31 139 $(Q)mkdir -p "$(BINDIR)"
fd676deb 140 $(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
bde51e6a 141
a1a84f69 142install-data: $(DATA_FILES)
63611f31 143 $(Q)mkdir -p "$(DATADIR)"
fd676deb 144 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
a1a84f69 145
bde51e6a 146install-man: $(MANPAGES)
63611f31 147 $(Q)mkdir -p "$(MANDIR)/man1"
fd676deb 148 $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
bde51e6a 149
d3cb93b3
RP
150uninstall: uninstall-progs uninstall-data uninstall-man
151
152uninstall-progs:
50e10cbd 153 $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
d3cb93b3
RP
154
155uninstall-data:
50e10cbd 156 $(RM) -r "$(DATADIR)"
d3cb93b3
RP
157
158uninstall-man:
50e10cbd 159 $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
bde51e6a 160
250dd6f0 161testclean:
50e10cbd
MR
162 $(RM) -r tests/vsynth1 tests/vsynth2 tests/data
163 $(RM) $(addprefix tests/,$(CLEANSUFFIXES))
164 $(RM) tests/seek_test$(EXESUF) tests/seek_test.o
3d157bf3 165 $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
250dd6f0
FC
166
167clean:: testclean
50e10cbd
MR
168 $(RM) $(ALLPROGS) $(ALLPROGS_G)
169 $(RM) $(CLEANSUFFIXES)
170 $(RM) doc/*.html doc/*.pod doc/*.1
171 $(RM) $(TOOLS)
bde51e6a
JR
172
173distclean::
50e10cbd
MR
174 $(RM) $(DISTCLEANSUFFIXES)
175 $(RM) version.h config.* libavutil/avconfig.h
bde51e6a 176
9d0b3042 177config:
0c3b2d65
MR
178 $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
179
bde51e6a
JR
180# regression tests
181
5bab8536
DB
182check: test checkheaders
183
b3dce4b9 184fulltest test: codectest lavftest lavfitest seektest
bde51e6a 185
bde51e6a 186FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
bde51e6a
JR
187SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
188
57f09630
MR
189codectest: fate-codec
190lavftest: fate-lavf
191lavfitest: fate-lavfi
192seektest: fate-seek
40e02409 193
9770a7ad
MR
194AREF = tests/data/acodec.ref.wav
195VREF = tests/data/vsynth1.ref.yuv
196REFS = $(AREF) $(VREF)
197
57f09630 198$(REFS): TAG = GEN
bde51e6a 199
9be24c60 200$(VREF): ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm
57f09630
MR
201 $(M)$(SRC_PATH)/tests/codec-regression.sh vref vsynth1 tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
202 $(Q)$(SRC_PATH)/tests/codec-regression.sh vref vsynth2 tests/vsynth2 "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 203
9be24c60 204$(AREF): ffmpeg$(EXESUF) tests/data/asynth1.sw
57f09630 205 $(M)$(SRC_PATH)/tests/codec-regression.sh aref acodec tests/acodec "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 206
d7167f05 207ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
bde51e6a
JR
208 @echo
209 @echo "Unfortunately ffserver is broken and therefore its regression"
210 @echo "test fails randomly. Treat the results accordingly."
211 @echo
767e14c3 212 $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
bde51e6a 213
82bb3329 214tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
4ab20de6
MR
215 @mkdir -p tests/vsynth1
216 $(M)$(BUILD_ROOT)/$< 'tests/vsynth1/'
bde51e6a 217
82bb3329 218tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
4ab20de6
MR
219 @mkdir -p tests/vsynth2
220 $(M)$(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
bde51e6a 221
d7167f05 222tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
4ab20de6
MR
223 @mkdir -p tests/data
224 $(M)$(BUILD_ROOT)/$< $@
225
226tests/data/asynth1.sw tests/vsynth%/00.pgm: TAG = GEN
bde51e6a 227
684b28e0
MR
228tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
229 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
bde51e6a 230
43d2c6a5
SS
231tools/lavfi-showfiltfmts$(EXESUF): tools/lavfi-showfiltfmts.o $(FF_DEP_LIBS)
232 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
233
2fad0977 234include $(SRC_PATH_BARE)/tests/fate.mak
7e264ca1
MR
235include $(SRC_PATH_BARE)/tests/fate2.mak
236
4c3fbd4f
MR
237include $(SRC_PATH_BARE)/tests/fate/aac.mak
238include $(SRC_PATH_BARE)/tests/fate/als.mak
239include $(SRC_PATH_BARE)/tests/fate/fft.mak
240include $(SRC_PATH_BARE)/tests/fate/h264.mak
680aefa2 241include $(SRC_PATH_BARE)/tests/fate/mp3.mak
4c3fbd4f
MR
242include $(SRC_PATH_BARE)/tests/fate/vorbis.mak
243include $(SRC_PATH_BARE)/tests/fate/vp8.mak
244
57f09630
MR
245FATE_ACODEC = $(ACODEC_TESTS:%=fate-acodec-%)
246FATE_VSYNTH1 = $(VCODEC_TESTS:%=fate-vsynth1-%)
247FATE_VSYNTH2 = $(VCODEC_TESTS:%=fate-vsynth2-%)
9a3f31ef 248FATE_VCODEC = $(FATE_VSYNTH1) $(FATE_VSYNTH2)
57f09630
MR
249FATE_LAVF = $(LAVF_TESTS:%=fate-lavf-%)
250FATE_LAVFI = $(LAVFI_TESTS:%=fate-lavfi-%)
9a3f31ef
MR
251FATE_SEEK = $(SEEK_TESTS:seek_%=fate-seek-%)
252
253FATE = $(FATE_ACODEC) \
254 $(FATE_VCODEC) \
255 $(FATE_LAVF) \
256 $(FATE_LAVFI) \
257 $(FATE_SEEK) \
258
259$(FATE_ACODEC): $(AREF)
260$(FATE_VCODEC): $(VREF)
261$(FATE_LAVF): $(REFS)
43d2c6a5 262$(FATE_LAVFI): $(REFS) tools/lavfi-showfiltfmts$(EXESUF)
9a3f31ef
MR
263$(FATE_SEEK): fate-codec fate-lavf tests/seek_test$(EXESUF)
264
265$(FATE_ACODEC): CMD = codectest acodec
266$(FATE_VSYNTH1): CMD = codectest vsynth1
267$(FATE_VSYNTH2): CMD = codectest vsynth2
268$(FATE_LAVF): CMD = lavftest
269$(FATE_LAVFI): CMD = lavfitest
270$(FATE_SEEK): CMD = seektest
271
272fate-codec: fate-acodec fate-vcodec
273fate-acodec: $(FATE_ACODEC)
274fate-vcodec: $(FATE_VCODEC)
275fate-lavf: $(FATE_LAVF)
276fate-lavfi: $(FATE_LAVFI)
277fate-seek: $(FATE_SEEK)
278
666d7d18 279ifdef SAMPLES
9a3f31ef 280FATE += $(FATE_TESTS)
2fad0977 281else
715e9be2 282$(FATE_TESTS):
2fad0977
MR
283 @echo "SAMPLES not specified, cannot run FATE"
284endif
bde51e6a 285
b82be636
MR
286FATE_UTILS = base64 tiny_psnr
287
9a3f31ef 288fate: $(FATE)
9a3f31ef 289
b82be636 290$(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
f6ae77d4 291 @echo "TEST $(@:fate-%=%)"
9a3f31ef
MR
292 $(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)'
293
d29d9ccc
MR
294fate-list:
295 @printf '%s\n' $(sort $(FATE))
296
34ae2d90 297.PHONY: documentation *test regtest-* alltools check config