Add Install Rules (#312)
[hadrian.git] / src / Main.hs
1 module Main (main) where
2
3 import Development.Shake
4
5 import qualified CmdLineFlag
6 import qualified Environment
7 import qualified Rules
8 import qualified Rules.Clean
9 import qualified Rules.Install
10 import qualified Rules.Oracles
11 import qualified Rules.SourceDist
12 import qualified Rules.Selftest
13 import qualified Rules.Test
14 import qualified Settings.Path
15
16 main :: IO ()
17 main = shakeArgsWith options CmdLineFlag.cmdFlags $ \cmdLineFlags targets -> do
18 CmdLineFlag.putCmdLineFlags cmdLineFlags
19 Environment.setupEnvironment
20 return . Just $ if null targets
21 then rules
22 else want targets >> withoutActions rules
23 where
24 rules :: Rules ()
25 rules = do
26 Rules.Clean.cleanRules
27 Rules.Oracles.oracleRules
28 Rules.SourceDist.sourceDistRules
29 Rules.Selftest.selftestRules
30 Rules.Test.testRules
31 Rules.buildRules
32 Rules.topLevelTargets
33 Rules.Install.installRules
34 options :: ShakeOptions
35 options = shakeOptions
36 { shakeChange = ChangeModtimeAndDigest
37 , shakeFiles = Settings.Path.shakeFilesPath
38 , shakeProgress = progressSimple
39 , shakeTimings = True }