Changes between Version 7 and Version 8 of Attic/Building/BuildSystem/New


Ignore:
Timestamp:
Jan 13, 2009 12:23:09 PM (7 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Attic/Building/BuildSystem/New

    v7 v8  
    9292below).
    9393
     94== Idiom: interaction with Cabal ==
     95
     96Many of the components of the GHC build system are also Cabal
     97packages, with package metadata defined in a `foo.cabal` file. For the
     98GHC build system we need to extract that metadata and use it to build
     99the package. This is done by the program `ghc-cabal` (in `utils/ghc-cabal`
     100in the GHC source tree). This program reads `foo.cabal` and produces
     101`package-data.mk` containing the package metadata in the form of
     102makefile bindings that we can use directly.
     103
     104We adhere to the following rule: '''`ghc-cabal` generates only
     105makefile variable bindings''', such as
     106{{{
     107  HS_SRCS = Foo.hs Bar.hs
     108}}}
     109`ghc-cabal` never generates makefile rules, macro, macro invocations etc.
     110All the makefile code is therefore contained in fixed, editable
     111`.mk` files.
     112
    94113== Idiom: variable names ==
    95114
     
    185204   `.depend`, which is included as normal.
    186205
    187  * `package-data.mk`.  Many of the components of the GHC build system
    188    are also Cabal packages, with package metadata defined in a
    189    `foo.cabal` file.  For the GHC build system we need to extract that
    190    metadata and use it to build the package.  This is done by the
    191    program `ghc-cabal` (in `utils/ghc-cabal` in the GHC source tree).
    192    This program reads `foo.cabal` and produces `package-data.mk`
    193    containing the package metadata in the form of makefile bindings
    194    that we can use directly.
    195 
    196 Now, we also want to be able to use make to build these files, since
    197 they have complex dependencies themselves (in order to build
    198 `package-data.mk` we need to first build `ghc-cabal` etc., and a `.depend` file needs to be re-generated if any of the source files have changed).
     206 * Makefile binding generated from `.cabal` package descriptions.  See
     207   "Idiom: interaction with Cabal".
     208
     209Now, we also want to be able to use `make` to build these files, since
     210they have complex dependencies themselves.  For example, in order to build
     211`package-data.mk` we need to first build `ghc-cabal` etc., and a `.depend` file needs to be re-generated if any of the source files have changed.
    199212
    200213GNU make has a clever strategy for handling this kind of scenario.  It