summaryrefslogtreecommitdiff
path: root/rules/trace.mk
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-09-21 13:47:29 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-09-21 13:47:29 +0000
commit75d9236613acdcfa54deb81b12bd4546c31e7c9f (patch)
treeaba9667bbdc8518d431ee79a6190069f736a61b0 /rules/trace.mk
parent6a1dd52566ae92ce133e751d9a800a8631b05b73 (diff)
downloadhaskell-75d9236613acdcfa54deb81b12bd4546c31e7c9f.tar.gz
add a simple trace facility to the build system
saying make TRACE=1 prints most of the macro calls and their arguments. It's easy to trace new macros; see rules/trace.mk.
Diffstat (limited to 'rules/trace.mk')
-rw-r--r--rules/trace.mk21
1 files changed, 21 insertions, 0 deletions
diff --git a/rules/trace.mk b/rules/trace.mk
new file mode 100644
index 0000000000..356f121d23
--- /dev/null
+++ b/rules/trace.mk
@@ -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