dba435b4b240bb70b59018d4989acc048f908bfb
[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 -/- "package-data.mk"]
25
26 -- TODO: add Stage2 (compiler only?)
27 packageRules :: Rules ()
28 packageRules =
29 forM_ [Stage0, Stage1] $ \stage -> do
30 forM_ knownPackages $ \pkg -> do
31 buildPackage (stagePackageTarget stage pkg)