+RELEASE_BASENAME = $$(RELEASE_PREFIX)-$$(RELEASE_VERSION)
+
+.PHONY: $$(RELEASE_BASENAME).zip .git/info/attributes
+
+.git/info/attributes: A = $$(shell git rev-parse --git-dir)/info/attributes
+.git/info/attributes:
+# Ensure that attributes do not exist or are generated by us
+ test ! -e $$A || head -n 1 $$A | grep -F "Automatically generated (yoo9jei6Ee6Teiti)"
+ echo "# Automatically generated (yoo9jei6Ee6Teiti)" > $$A
+# Write ignored files there
+ for i in `$$(RELEASE_IGNORE_FILES_CMD)`; do echo $$$$i export-ignore >> $$A; echo Not releasing $$$$i; done
+
+$$(RELEASE_BASENAME).zip:
+ rm -rf $$@ $$(RELEASE_BASENAME)
+ $(MAKE) $$(RELEASE_BASENAME)
+ find $$(RELEASE_BASENAME) -type d -empty -print -delete
+ zip -r $$@ $$(RELEASE_BASENAME)
+
+$$(RELEASE_BASENAME):: .git/info/attributes
+ git archive --worktree-attributes --prefix=$$@/ $$(RELEASE_COMMIT) | tar xf -
+
+print-release-basename:
+ @echo $$(RELEASE_BASENAME)
+endef
+
+# Case conversion macros. Taken from
+# http://git.buildroot.net/buildroot/tree/package/pkg-utils.mk. This
+# is inspired by the 'up' macro from gmsl (http://gmsl.sf.net). It is
+# optimised very heavily because these macros are used a lot. It is
+# about 5 times faster than forking a shell and tr.
+#
+# The caseconvert-helper creates a definition of the case conversion macro.
+# After expansion by the outer $(eval ), the UPPERCASE macro is defined as:
+# $(strip $(eval __tmp := $(1)) $(eval __tmp := $(subst a,A,$(__tmp))) ... )
+# In other words, every letter is substituted one by one.
+#
+# The caseconvert-helper allows us to create this definition out of the
+# [FROM] and [TO] lists, so we don't need to write down every substition
+# manually. The uses of $ and $$ quoting are chosen in order to do as
+# much expansion as possible up-front.
+#
+# Note that it would be possible to conceive a slightly more optimal
+# implementation that avoids the use of __tmp, but that would be even
+# more unreadable and is not worth the effort.