Add comments. Minor refactoring.
[hadrian.git] / src / UserSettings.hs
1 module UserSettings (
2 userSettings, userPackages, userWays,
3
4 buildHaddock, validating
5 ) where
6
7 import Base hiding (arg, args, Args)
8 import Oracles.Builder
9 import Ways
10 import Targets
11 import Switches
12 import Expression
13 import Settings.Util
14
15 -- No user-specific settings by default
16 userSettings :: Settings
17 userSettings = mempty
18
19 -- Control conditions of which packages get to be built
20 -- TODO: adding *new* packages is not possible (see knownPackages in Targets.hs)
21 userPackages :: Packages
22 userPackages = mempty
23
24 -- Control which ways are built
25 userWays :: Ways
26 userWays = mempty
27
28 -- User-defined predicates
29 -- TODO: migrate more predicates here from configuration files
30 buildHaddock :: Predicate
31 buildHaddock = return True
32
33 validating :: Predicate
34 validating = return False
35
36 -- Examples:
37 userSettings' :: Settings
38 userSettings' = mconcat
39 [ package compiler ? stage0 ? arg "foo"
40 , builder (Ghc Stage0) ? remove ["-O2"]
41 , builder GhcCabal ? removeSub "--configure-option=CFLAGS" ["-Werror"] ]
42
43 userPackages' :: Packages
44 userPackages' = mconcat
45 [ stage1 ? remove [cabal]
46 , remove [compiler] ]
47
48 userWays' :: Ways
49 userWays' = remove [profiling]