+tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data
+ $(M)./$< $@ $(subst -, ,$*)
+
+tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
+ $(M)$< $@
+
+tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
+ $(M)$< $(SRC_PATH)/tests/reference.pnm $@
+
+tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm: TAG = GEN
+
+tests/data/filtergraphs/%: TAG = COPY
+tests/data/filtergraphs/%: $(SRC_PATH)/tests/filtergraphs/% | tests/data/filtergraphs
+ $(M)cp $< $@
+
+RUNNING_FATE := $(filter check fate%,$(filter-out fate-rsync,$(MAKECMDGOALS)))
+
+# Check sanity of dependencies when running FATE tests.
+ifneq (,$(RUNNING_FATE))
+CHKCFG = $(if $($(1))$(!$(1)),$($(1)), $(error No such config: $(1)))
+endif
+
+ALLYES = $(strip $(call XYES, $(1)))
+XYES = $(if $(strip $(1)), \
+ $(if $(call CHKCFG,CONFIG_$(firstword $(1))), \
+ $(call XYES, $(wordlist 2, $(words $(1)), $(1)))), \
+ yes)
+
+ENCDEC = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \
+ $(firstword $(2))_MUXER $(lastword $(2))_DEMUXER)
+
+ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \
+ $(firstword $(2))_ENCODER $(lastword $(2))_DECODER \
+ $(firstword $(3))_MUXER $(lastword $(3))_DEMUXER)