summaryrefslogtreecommitdiff
path: root/ghc.mk
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-05-24 17:31:35 +0100
committerIan Lynagh <ian@well-typed.com>2013-05-25 19:17:29 +0100
commit6f36790b812ebf4fde87a26e611d249e6c978045 (patch)
treebbd3074e0241bc099362dc2f74c8869c76c22131 /ghc.mk
parentd8dd3cf954a9bb77d9caa64290fcea0d1abb32ec (diff)
downloadhaskell-6f36790b812ebf4fde87a26e611d249e6c978045.tar.gz
Add an echo target to the build system
Diffstat (limited to 'ghc.mk')
-rw-r--r--ghc.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/ghc.mk b/ghc.mk
index 7b66cfd499..ad0a381a39 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -110,6 +110,14 @@ comma=,
show:
@echo '$(VALUE)="$($(VALUE))"'
+# echo is used by the nightly builders to query the build system for
+# information.
+# Using printf means that we don't get a trailing newline. We escape
+# backslashes and double quotes in the string to protect them from the
+# shell, and percent signs to protect them from printf.
+echo:
+ @printf "$(subst %,%%,$(subst ",\",$(subst \,\\\\,$($(VALUE)))))"
+
# -----------------------------------------------------------------------------
# Include subsidiary build-system bits