Add Base.hs with Shake imports and build paths.
[hadrian.git] / src / Rules.hs
1 module Rules (
2 generateTargets, packageRules, oracleRules,
3 module Rules.Config,
4 module Rules.Package,
5 ) where
6
7 import Base
8 import Util
9 import Stage
10 import Expression
11 import Rules.Config
12 import Rules.Package
13 import Rules.Oracles
14 import Settings.Packages
15 import Settings.TargetDirectory
16
17 -- generateTargets needs package-data.mk files of all target packages
18 -- TODO: make interpretDiff total
19 generateTargets :: Rules ()
20 generateTargets = action $ do
21 targets <- fmap concat . forM [Stage0 ..] $ \stage -> do
22 pkgs <- interpret (stageTarget stage) packages
23 fmap concat . forM pkgs $ \pkg -> return
24 [ targetPath stage pkg -/- "build/haskell.deps"
25 , targetPath stage pkg -/- "build/c.deps" ]
26 need targets
27
28 -- TODO: add Stage2 (compiler only?)
29 packageRules :: Rules ()
30 packageRules =
31 forM_ [Stage0, Stage1] $ \stage -> do
32 forM_ knownPackages $ \pkg -> do
33 buildPackage (stagePackageTarget stage pkg)