Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,968
    • Issues 4,968
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 460
    • Merge requests 460
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Wiki
  • Building
  • modifying

modifying · Changes

Page history
document make TRACE=1 authored Sep 21, 2010 by Simon Marlow's avatar Simon Marlow
Hide whitespace changes
Inline Side-by-side
building/modifying.md
View page @ 19a56108
......@@ -21,14 +21,31 @@ the wrong order, or some variable isn't being propagated to the places
you thought it was. How do you go about debugging the build system?
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.
Here are the techniques that we use. Note, for many of these diagnosis techniques you may want to invoke
**make** on `ghc.mk` directly using `make -f ghc.mk`, to bypass the
[phase ordering](building/architecture/idiom/phase-ordering) machinery of the top-level
`Makefile`.
<table><tr><th>`$(warning ... message ...)`</th>
<td>
equivalent to "printf-debugging\` in a C program: this causes
**make** to print a message when it reads the `$(warning ..)`
expression, and the message can include variable references. Very
useful for finding out what **make** thinks the value of a
variable is at a particular point in the `Makefile`, or for finding
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.
</td></tr></table>
<table><tr><th>`make show VALUE=VAR`</th>
<td>
prints the value of variable `VAR`. Useful for quick diagnosis.
</td></tr></table>
<table><tr><th>`make TRACE=1`</th>
<td>
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 [rules/trace.mk](/trac/ghc/browser/ghc/rules/trace.mk), and feel free to add trace calls to more places in the build system.
</td></tr></table>
<table><tr><th>`make --debug=b --debug=m`</th>
<td>
causes **make** to show the sequence of dependencies that it is
......@@ -44,21 +61,6 @@ huge; so pipe it to a file, and search through it for the bits of
interest.
</td></tr></table>
<table><tr><th>`$(warning ... message ...)`</th>
<td>
equivalent to "printf-debugging\` in a C program: this causes
**make** to print a message when it reads the `$(warning ..)`
expression, and the message can include variable references. Very
useful for finding out what **make** thinks the value of a
variable is at a particular point in the `Makefile`, or for finding
out the parameters for a particular macro call.
</td></tr></table>
<table><tr><th>`make show VALUE=VAR`</th>
<td>
prints the value of variable `VAR`. Useful for quick diagnosis.
</td></tr></table>
## Scenarios
......
Clone repository Edit sidebar
  • 9.6
  • Adventures in GHC compile times
  • All things layout
  • AndreasK
  • AndreasPK
  • Back End and Run Time System
  • Backpack refactoring
  • Backpack units
  • Brief Guide for Compiling GHC to iOS
  • Building GHC on Windows with Stack protector support (SSP) (using Make)
  • CAFs
  • CafInfo rework
  • Compiling Case Expressions in ghc
  • Compiling Data.Aeson Error
  • Contributing a Patch
View All Pages