Commit 94638520 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Parallelise build by collecting targets and then needing them.

parent 096b595b
module Rules (
generateTargets, packageRules, oracleRules,
module Rules.Package,
module Rules.Config,
module Rules.Package,
) where
import Util
......@@ -17,12 +17,13 @@ import Development.Shake
-- generateTargets needs package-data.mk files of all target packages
-- TODO: make interpretDiff total
generateTargets :: Rules ()
generateTargets = action $
forM_ [Stage0 ..] $ \stage -> do
generateTargets = action $ do
targets <- fmap concat . forM [Stage0 ..] $ \stage -> do
pkgs <- interpret (stageTarget stage) packages
forM_ pkgs $ \pkg -> do
need [targetPath stage pkg -/- "build/haskell.deps"]
need [targetPath stage pkg -/- "build/c.deps"]
fmap concat . forM pkgs $ \pkg -> return
[ targetPath stage pkg -/- "build/haskell.deps"
, targetPath stage pkg -/- "build/c.deps" ]
need targets
-- TODO: add Stage2 (compiler only?)
packageRules :: Rules ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment