|
Revision 75d9236613acdcfa54deb81b12bd4546c31e7c9f, 0.7 KB
(checked in by Simon Marlow <marlowsd@…>, 21 months ago)
|
|
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.
|
-
Property mode set to
100644
|
| Line | |
|---|
| 1 | # ----------------------------------------------------------------------------- |
|---|
| 2 | # |
|---|
| 3 | # (c) 2010 The University of Glasgow |
|---|
| 4 | # |
|---|
| 5 | # This file is part of the GHC build system. |
|---|
| 6 | # |
|---|
| 7 | # To understand how the build system works and how to modify it, see |
|---|
| 8 | # http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture |
|---|
| 9 | # http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying |
|---|
| 10 | # |
|---|
| 11 | # ----------------------------------------------------------------------------- |
|---|
| 12 | |
|---|
| 13 | # A helpful little debug macro. Call it from a macro like this: |
|---|
| 14 | # |
|---|
| 15 | # $(call trace, this-macro($1,$2,$3)) |
|---|
| 16 | # |
|---|
| 17 | # And invoke the build system with TRACE=1 to turn on tracing. |
|---|
| 18 | |
|---|
| 19 | define trace |
|---|
| 20 | $$(if $(TRACE),$$(warning $1),) |
|---|
| 21 | endef |
|---|