Changes between Version 7 and Version 8 of Building/Modifying


Ignore:
Timestamp:
Sep 21, 2010 2:49:36 PM (4 years ago)
Author:
simonmar
Comment:

document make TRACE=1

Legend:

Unmodified
Added
Removed
Modified
  • Building/Modifying

    v7 v8  
    1919you thought it was.  How do you go about debugging the build system? 
    2020 
    21 Debugging techniques can also be a handy way to understand how the build system works.  Want to test your hypothesis about what the variable `rts_C_SRCS` contains?  Just add a `$(warning $(rts_C_SRCS))` somewhere. 
    22  
    2321Here are the techniques that we use.  Note, for many of these diagnosis techniques you may want to invoke 
    2422'''make''' on `ghc.mk` directly using `make -f ghc.mk`, to bypass the 
    2523[wiki:Building/Architecture/Idiom/PhaseOrdering phase ordering] machinery of the top-level 
    2624`Makefile`. 
     25 
     26 `$(warning ... message ...)`:: 
     27  equivalent to "printf-debugging` in a C program: this causes 
     28  '''make''' to print a message when it reads the `$(warning ..)` 
     29  expression, and the message can include variable references.  Very 
     30  useful for finding out what '''make''' thinks the value of a 
     31  variable is at a particular point in the `Makefile`, or for finding 
     32  out the parameters for a particular macro call.    Want to test your hypothesis about what the variable `rts_C_SRCS` contains?  Just add a `$(warning $(rts_C_SRCS))` somewhere. 
     33 
     34 `make show VALUE=VAR`:: 
     35  prints the value of variable `VAR`.  Useful for quick diagnosis. 
     36 
     37 `make TRACE=1`:: 
     38  prints messages about certain macros that are called and their arguments.  This is basically a system of `$(warning)` calls enabled when the value of `$(TRACE)` is non-empty.  To see how it works, look at the file [[GhcFile(rules/trace.mk)]], and feel free to add trace calls to more places in the build system. 
    2739 
    2840 `make --debug=b --debug=m`:: 
     
    3648  huge; so pipe it to a file, and search through it for the bits of 
    3749  interest. 
    38  
    39  `$(warning ... message ...)`:: 
    40   equivalent to "printf-debugging` in a C program: this causes 
    41   '''make''' to print a message when it reads the `$(warning ..)` 
    42   expression, and the message can include variable references.  Very 
    43   useful for finding out what '''make''' thinks the value of a 
    44   variable is at a particular point in the `Makefile`, or for finding 
    45   out the parameters for a particular macro call. 
    46  
    47  `make show VALUE=VAR`:: 
    48   prints the value of variable `VAR`.  Useful for quick diagnosis. 
    4950 
    5051== Scenarios ==