Changes between Version 12 and Version 13 of Building/Hacking


Ignore:
Timestamp:
Oct 6, 2006 11:42:25 AM (9 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Building/Hacking

    v12 v13  
    1212on the build system, read on to the later sections. 
    1313 
    14 == Setting up your build == 
     14 
     15== Controlling your build: `mk/build.mk` == 
     16 
     17{{{mk/build.mk}}} is a GNU makefile that contains all your build settings. 
     18By default, this file doesn't exist, and all the parameters are set to 
     19their defaults in {{{mk/config.mk}}} ({{{mk/config.mk}}} is the place to look for 
     20''all'' the things you might want to tune). 
     21 
     22There's an example in [[GhcFile(mk/build.mk.sample)]], which you can copy to `mk/build.mk` and edit as required. 
     23Alternatively if you want to understand a bit more about what's going on (recommended), read on. 
     24 
     25== How to make GHC build quickly == 
    1526 
    1627The GHC build tree is set up so that, by default, it builds a compiler 
     
    2233first place, and quick to rebuild after making changes.  Tuning your 
    2334build setup can make the difference between several hours to build 
    24 GHC, and less than an hour.  Here's how to do it. 
    25  
    26 If you're just interested in working on GHC, then you probably don't want 
    27 the "extralibs" libraries that we normally ship with GHC, having these in your 
    28 source tree will just make the build take longer.  So when  
    29 [wiki:Building/GettingTheSources getting the sources], run `darcs-all` without 
    30 the `--extra` option. 
    31  
    32 === `mk/build.mk` === 
    33  
    34 {{{mk/build.mk}}} is a GNU makefile that contains all your build settings. 
    35 By default, this file doesn't exist, and all the parameters are set to 
    36 their defaults in {{{mk/config.mk}}} ({{{mk/config.mk}}} is the place to look for 
    37 ''all'' the things you might want to tune). 
    38  
    39 There's an example in [[GhcFile(mk/build.mk.sample)]], which you can copy to `mk/build.mk` and edit as required. 
    40 Alternatively if you want to understand a bit more about what's going on (recommended), read on. 
    41  
    42 A good {{{mk/build.mk}}} to start hacking on GHC is: 
     35GHC, and less than an hour.  Here are the `build.mk` settings that 
     36we use to build fast: 
    4337 
    4438{{{ 
     
    4943GhcLibWays      = 
    5044SplitObjs       = NO 
     45GhcBootLibs     = YES 
    5146}}} 
    5247 
     
    6964  ''much'' quicker, not only because the individual compilations will be 
    7065  quicker, but also there will be fewer dependencies between modules, 
    71   so less stuff needs to be rebuilt after each modification. 
     66  so much less stuff is recompiled after each modification. 
    7267  [[br]][[br]] 
    7368  Also we turn on {{{-DDEBUG}}}, because that enables assertions and 
     
    9388  memory-consuming, so turn it off when you're hacking. 
    9489 
     90 {{{GhcBootLibs = YES}}}:: 
     91  If you're just interested in working on GHC, then you probably don't want 
     92  to build the "extralibs" libraries that we normally ship with GHC.   
     93  So when [wiki:Building/GettingTheSources getting the sources],  
     94  run `darcs-all` without the `--extra` option.  Alternatively, even if you have 
     95  the libraries in your tree, you can stop them being built by setting 
     96  `GhcBootLibs` in your `build.mk`. 
     97 
     98  
    9599 
    96100== Actually building the bits ==