add a simple trace facility to the build system
[ghc-hetmet.git] / rules / trace.mk
diff --git a/rules/trace.mk b/rules/trace.mk
new file mode 100644 (file)
index 0000000..356f121
--- /dev/null
@@ -0,0 +1,21 @@
+# -----------------------------------------------------------------------------
+#
+# (c) 2010 The University of Glasgow
+#
+# This file is part of the GHC build system.
+#
+# To understand how the build system works and how to modify it, see
+#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
+#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
+#
+# -----------------------------------------------------------------------------
+
+# A helpful little debug macro.  Call it from a macro like this:
+# 
+#  $(call trace, this-macro($1,$2,$3))
+#
+# And invoke the build system with TRACE=1 to turn on tracing.
+
+define trace
+$$(if $(TRACE),$$(warning $1),)
+endef