[commit: ghc] master: Add an echo target to the build system (6f36790)

Ian Lynagh igloo at earth.li
Sat May 25 22:02:58 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/6f36790b812ebf4fde87a26e611d249e6c978045

>---------------------------------------------------------------

commit 6f36790b812ebf4fde87a26e611d249e6c978045
Author: Ian Lynagh <ian at well-typed.com>
Date:   Fri May 24 17:31:35 2013 +0100

    Add an echo target to the build system

>---------------------------------------------------------------

 Makefile | 4 ++--
 ghc.mk   | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 912af1f..a2cea2c 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 7b66cfd..ad0a381 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
 





More information about the ghc-commits mailing list