Default.hs 3 KB
Newer Older
1 2 3
module Settings.Default (
    defaultTargetDirectory, defaultKnownPackages,

4
    array, base, binPackageDb, binary, bytestring, cabal, compiler, containers,
5 6 7
    deepseq, directory, filepath, ghcPrim, haskeline, hoopl, hpc, integerGmp,
    integerGmp2, integerSimple, parallel, pretty, primitive, process, stm,
    templateHaskell, terminfo, time, transformers, unix, win32, xhtml
8
    ) where
9

10
import Base
11
import Package
12

13 14 15 16 17
-- Build results will be placed into a target directory with the following
-- typical structure:
-- * build/           : contains compiled object code
-- * doc/             : produced by haddock
-- * package-data.mk  : contains output of ghc-cabal applied to pkgCabal
18 19
defaultTargetDirectory :: Stage -> Package -> FilePath
defaultTargetDirectory stage package
Andrey Mokhov's avatar
Andrey Mokhov committed
20
    | package == compiler = "stage" ++ show (fromEnum stage + 1)
21 22
    | stage   == Stage0   = "dist-boot"
    | otherwise           = "dist-install"
Andrey Mokhov's avatar
Andrey Mokhov committed
23

24 25 26 27 28 29 30 31 32 33 34 35 36
-- These are all packages we know about. Build rules will be generated for
-- all of them. However, not all of these packages will be built. For example,
-- package 'win32' is built only on Windows.
-- Settings/Packages.hs defines default conditions for building each package,
-- which can be overridden in UserSettings.hs.
defaultKnownPackages :: [Package]
defaultKnownPackages =
    [ array, base, binPackageDb, binary, bytestring, cabal, compiler
    , containers, deepseq, directory, filepath, ghcPrim, haskeline
    , hoopl, hpc, integerGmp, integerGmp2, integerSimple, parallel
    , pretty, primitive, process, stm, templateHaskell, terminfo, time
    , transformers, unix, win32, xhtml ]

37
-- Package definitions
Andrey Mokhov's avatar
Andrey Mokhov committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
array           = library  "array"
base            = library  "base"
binPackageDb    = library  "bin-package-db"
binary          = library  "binary"
bytestring      = library  "bytestring"
cabal           = library  "Cabal/Cabal" `setCabal` "Cabal.cabal"
compiler        = topLevel "compiler"    `setCabal` "ghc.cabal"
containers      = library  "containers"
deepseq         = library  "deepseq"
directory       = library  "directory"
filepath        = library  "filepath"
ghcPrim         = library  "ghc-prim"
haskeline       = library  "haskeline"
hoopl           = library  "hoopl"
hpc             = library  "hpc"
53 54 55
integerGmp      = library  "integer-gmp"
integerGmp2     = library  "integer-gmp2" `setCabal` "integer-gmp.cabal"
integerSimple   = library  "integer-simple"
Andrey Mokhov's avatar
Andrey Mokhov committed
56 57 58 59 60 61 62 63 64 65 66 67
parallel        = library  "parallel"
pretty          = library  "pretty"
primitive       = library  "primitive"
process         = library  "process"
stm             = library  "stm"
templateHaskell = library  "template-haskell"
terminfo        = library  "terminfo"
time            = library  "time"
transformers    = library  "transformers"
unix            = library  "unix"
win32           = library  "Win32"
xhtml           = library  "xhtml"
68

69
-- Note [Cabal name weirdness]
70 71
-- Find out if we can move the contents to just Cabal/
-- What is Cabal/cabal-install? Do we need it?
72
-- A related question about gmp2 -- let's rename the cabal file?