+CLEANFILES += $(OUTDIR)/pkg/lib/*/lib*.so
+CLEANFILES += $(OUTDIR)/lib.host-$(hostcpu)/lib*.so
+
+###--------------------------------------------------------------------------
+### Android string resource generation.
+
+GENSTRINGS += package=PACKAGE
+GENSTRINGS += version=VERSION
+GENSTRINGS += vsn=VSN
+
+$(foreach e,$(EXTERNALS),\
+ $(eval GENSTRINGS += $e_version=$e_VERSION))
+
+BUILD := $(shell uuid -v4)
+GENSTRINGS += build_uuid=BUILD
+
+genstring-name = $(firstword $(subst =, ,$1))
+genstring-value = $($(word 2,$(subst =, ,$1)))
+
+define gen-strings
+ $(V_AT)mkdir -p $(dir $1)
+ $(call v_tag,GEN)set -e; rm -f $1.new; exec >$1.new; \
+ echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; \
+ echo "<resources>"; \
+ $(foreach g,$(GENSTRINGS), \
+ echo " <string name=\"auto_$(call genstring-name,$g)\">$(call genstring-value,$g)</string>";) \
+ echo "</resources>"
+ $(V_AT)mv $1.new $1
+endef
+$(OUTDIR)/res.dummy/values/auto.xml: Makefile
+ $(call gen-strings,$@)