+
+SHELL := bash
+pf := set -o pipefail
+
+define isok
+ && echo " ok" || echo " no"
+endef
+
+# If ok, strip trailing " ok" and return the output, otherwise, error
+define shout
+$(if $(subst ok,,$(lastword $(1))),$(error $(2)),$(shell x="$(1)"; echo $${x%???}))
+endef
+
+sampledata_rev := $(shell t/configure-sampledata --revision $(isok))
+sampledata_rev := \
+ $(call shout,$(sampledata_rev),Could not parse sampledata revision)
+
+current_sampledata := t/sampledata/var/rev/v$(sampledata_rev)
+
+os := $(shell ($(pf); uname | sed 's/[-_].*//') $(isok))
+os := $(call shout,$(os),Unable to determine OS)
+