+# Define some useful functions. Don't use these functions directly because
+# they don't account for verbosity; instead use the functions without the
+# `func_' prefix (defined below).
+func_remove = rm -f $1
+func_install = mkdir -p $(DESTDIR)$3 && $(INSTALL) -m $1 $2 $(DESTDIR)$3
+func_dist = git archive HEAD --prefix='$(tarname)/' | $1 >"$(tarname).tar.$2" && \
+ (openssl md5 "$(tarname).tar.$2" 2>/dev/null || \
+ md5 "$(tarname).tar.$2" 2>/dev/null || \
+ md5sum "$(tarname).tar.$2" 2>/dev/null)
+
+# These commands and functions should be used in most recipes to compile
+# sources, link objects, compress files, create distfiles, install files, etc.
+compile_c = $(call func_print,CC,$@) $(cmd_compile_c)
+compile_cc = $(call func_print,CXX,$@) $(cmd_compile_cc)
+compile_rc = $(call func_print,RC,$@) $(cmd_compile_rc)
+link_c = $(call func_print,LINK,$@) $(cmd_link_c)
+link_cc = $(call func_print,LINK,$@) $(cmd_link_cc)
+compile_pch = $(call func_print,CC,$@) $(cmd_compile_pch)
+compile_pchh = $(call func_print,CXX,$@) $(cmd_compile_pchh)
+ar = $(call func_print,AR,$@) $(cmd_ar)
+sed = $(call func_print,SED,$@) $(cmd_sed)
+gzip = $(call func_print,GZIP,$@) $(cmd_gzip)
+bzip2 = $(call func_print,BZIP2,$@) $(cmd_bzip2)
+xxd = $(call func_print,XXD,$@) $(cmd_xxd)
+configure = $(call func_print,MAKE,$@) $(cmd_configure)
+dist = $(call func_print,DIST,$1) $(func_dist)
+remove = $(call func_print,RM,$1) $(func_remove)
+install = $(call func_print,CP,$(DESTDIR:%/=%)$(3:%/=%)/$(notdir $2)) $(func_install)
+
+# The mechanism used by this makefile to handle verbosity simply requires (by
+# convention) commands in rules to be prefixed with `$Q' and the commands and
+# functions defined above will then print a single line describing the command
+# instead of the entire command.