Changes between Version 30 and Version 31 of Building/Hacking
- Timestamp:
- 07/01/10 08:26:55 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Building/Hacking
v30 v31 5 5 6 6 There is more complete documentation for the build system later on in this guide (see [wiki:Building/Using]), but this page gives a quick overview of how to get around the GHC build system. 7 8 == Before starting your build == 9 10 You need to configure your build: which things to build, how much optimisation to use, whether to build profiling libraries, and so on. If you don't do this, then you get ''everything'', and it will be ''optimised to the hilt'', which means the build will take a Very Long Time. This is fine if you wanted to build GHC for installation and use, but not if you're building GHC to do some development work on it. 11 12 To configure your build, create the file {{{mk/build.mk}}} from the sample: 13 14 {{{ 15 $ cp mk/build.mk.sample mk/build.mk 16 }}} 17 18 and then edit {{{mk/build.mk}}} to select the build you want. If you're not sure what you 19 want, just uncommenting this line 20 21 {{{ 22 #BuildFlavour = quick 23 }}} 24 25 is usually a good choice. For more information on what you can do with `build.mk`, see [wiki:Building/Using#Buildconfiguration Build configuration]. In particular, you might want to [wiki:Building/Using#HowtomakeGHCbuildquickly make GHC build quickly]. 26 27 == Starting the build == 28 29 To build the whole thing (compiler, libraries, compiler again), do this: 30 31 {{{ 32 $ perl boot 33 $ ./configure 34 $ make 35 }}} 36 37 There are more configuration settings that you can use when running the configure script, see [wiki:Building/Using#Runtheconfigurescript Run the configure script]. 38 39 assuming everything goes according to plan, this should leave you with a compiler that you can run: {{{inplace/bin/ghc-stage2}}}. 7 40 8 41 == Building after making changes == … … 25 58 {{{ 26 59 $ cd ghc 27 $ make stage=260 $ make 2 28 61 }}} 29 62 … … 55 88 The GHC build system works with make's `-j` flag, which spawns multiple compile processes in parallel. Even on a single processor machine it's usually worthwhile using at least `make -j2`, because the I/O will be overlapped with compute-intensive compilation. On a multicore machine, higher `-j` values will speed up the build even more. 56 89 57 == Controlling your build ==58 59 The build is controlled in two ways:60 61 * Flags given to `./configure`. See [wiki:Building/Using#Runtheconfigurescript Run the configure script].62 63 * The file `mk/build.mk`. This is a file you create yourself, containing various build settings. There's a sample file in `mk/build.mk.sample` that you can copy to `mk/build.mk` and use as a starting point. For more information on what you can do with `build.mk`, see [wiki:Building/Using#Buildconfiguration Build configuration]. In particular, you might want to [wiki:Building/Using#HowtomakeGHCbuildquickly make GHC build quickly].64 65 90 == Running GHC from the build tree == 66 91
