Changes between Version 18 and Version 19 of Attic/Building/BuildSystem


Ignore:
Timestamp:
Aug 17, 2008 7:36:42 PM (6 years ago)
Author:
igloo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Attic/Building/BuildSystem

    v18 v19  
    124124Every {{{Makefile}}} includes a 
    125125{{{boilerplate.mk}}} 
    126 file at the top, and 
    127 {{{target.mk}}} 
    128 file at the bottom.  In this section we discuss what is in these 
    129 files, and why there have to be two of them.  In general: 
     126file at the top.  In this section we discuss what is in this 
     127file.  In general: 
    130128 
    131129       
     
    144142    * ''Standard pattern rules'' that 
    145143      tell {{{make}}} how to construct one file 
    146       from another. 
     144      from another. These rules are becoming more and more 
     145      redundant as we move to building with Cabal instead. 
    147146 
    148147  {{{boilerplate.mk}}} needs to be 
    149148  {{{include}}}d at the ''top'' 
    150149  of each {{{Makefile}}}, so that the user can 
    151   replace the boilerplate definitions or pattern rules by 
     150  replace the boilerplate variable definitions by 
    152151  simply giving a new definition or pattern rule in the 
    153152  {{{Makefile}}}.  {{{make}}} 
     
    165164  {{{SRC_HC_OPTS}}}. 
    166165 
    167  * {{{target.mk}}} contains 
     166 * {{{target.mk}}} is part of the old build system, but is still used 
     167   to compile some parts of GHC. It contains 
    168168   {{{make}}} rules for the standard targets 
    169169   described in [wiki:Building/Using#StandardTargets standard targets].  These 
     
    208208      forgotten, but it doesn't matter too much. 
    209209 
    210               
    211        
    212210 
    213211== The {{{mk/boilerplate.mk}}} file == 
     
    227225 
    228226=== {{{paths.mk}}} === 
     227 
     228is part of the old build system, i.e. it is not used by packages that are built with Cabal. 
    229229             
    230 defines {{{make}}} variables for 
     230`paths.mk` defines {{{make}}} variables for 
    231231pathnames and file lists.  This file contains code for 
    232232automatically compiling lists of source files and deriving 
     
    360360=== {{{suffix.mk}}} === 
    361361 
    362 defines standard pattern rules--see [[ref(Pattern rules and options)]]. 
     362is part of the old build system, i.e. it is not used by packages that are built with Cabal. 
     363 
     364`suffix.mk` defines standard pattern rules--see [[ref(Pattern rules and options)]]. 
    363365 
    364366       
     
    411413== Pattern rules and options == 
    412414 
     415This section relates mainly to the old build system. 
    413416 
    414417The file 
     
    496499== The main {{{mk/target.mk}}} file == 
    497500 
     501This section relates mainly to the old build system. 
    498502 
    499503{{{target.mk}}} contains canned rules for 
     
    588592most dependent last. 
    589593 
    590 == Way management == 
    591  
     594== Way management in the old build system == 
    592595 
    593596We sometimes want to build essentially the same system in 
    594597several different "ways".  For example, we want to build GHC's 
    595 {{{Prelude}}} libraries with and without profiling, 
     598runtime system libraries with and without thread support, 
    596599so that there is an appropriately-built library archive to link 
    597600with when the user compiles his program.  It would be possible 
     
    695698   directory.  
    696699 
     700== Way management in the new build system == 
     701 
     702When building with Cabal, way management is much simpler. 
     703 
     704For libraries, we simply tell Cabal whether or not it should also 
     705build profiling versions of the library. 
     706 
     707There are a couple of cases where we want something similar: 
     708For GHC itself, we want stage1, stage2 and stage3 builds; and for 
     709some utils, as discussed earlier, we want to build the util with 
     710both the bootstrapping compiler and the stage1 compiler. 
     711 
     712When Cabal builds a package, by default it does its building in a 
     713`dist` directory. In order to build packages in different ways, we 
     714use a different directory for each way, using the `--distpref` flag 
     715to tell Cabal which one to use. 
    697716 
    698717== When the canned rule isn't right ==