summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--ghc.mk8
2 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 912af1feac..a2cea2cae3 100644
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ endif
include mk/custom-settings.mk
# No need to update makefiles for these targets:
-REALGOALS=$(filter-out binary-dist binary-dist-prep bootstrapping-files framework-pkg clean clean_% distclean maintainer-clean show help test fulltest,$(MAKECMDGOALS))
+REALGOALS=$(filter-out binary-dist binary-dist-prep bootstrapping-files framework-pkg clean clean_% distclean maintainer-clean show echo help test fulltest,$(MAKECMDGOALS))
# configure touches certain files even if they haven't changed. This
# can mean a lot of unnecessary recompilation after a re-configure, so
@@ -93,7 +93,7 @@ clean distclean maintainer-clean:
$(filter clean_%, $(MAKECMDGOALS)) : clean_% :
$(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
-bootstrapping-files show:
+bootstrapping-files show echo:
$(MAKE) -r --no-print-directory -f ghc.mk $@
ifeq "$(darwin_TARGET_OS)" "1"
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