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