Add build system profiling to build system
[ghc-hetmet.git] / rules / prof.mk
diff --git a/rules/prof.mk b/rules/prof.mk
new file mode 100644 (file)
index 0000000..c80a7c5
--- /dev/null
@@ -0,0 +1,20 @@
+# -----------------------------------------------------------------------------
+#
+# (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
+#
+# -----------------------------------------------------------------------------
+
+define profStart
+$$(if $(PROF),$$(info $$(shell date +%s.%N): Start $1))
+endef
+
+define profEnd
+$$(if $(PROF),$$(info $$(shell date +%s.%N): End   $1))
+endef
+