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

Add library targets.

parent a6623ab5
...@@ -2,15 +2,19 @@ module Rules ( ...@@ -2,15 +2,19 @@ module Rules (
oracleRules, cabalRules, configRules, packageRules, generateTargets oracleRules, cabalRules, configRules, packageRules, generateTargets
) where ) where
import Way
import Base import Base
import Util import Util
import Stage import Stage
import Expression import Expression
import Oracles.PackageData
import Rules.Cabal import Rules.Cabal
import Rules.Config import Rules.Config
import Rules.Package import Rules.Package
import Rules.Oracles import Rules.Oracles
import Rules.Resources import Rules.Resources
import Settings.Ways
import Settings.Util
import Settings.Packages import Settings.Packages
import Settings.TargetDirectory import Settings.TargetDirectory
...@@ -19,9 +23,21 @@ generateTargets :: Rules () ...@@ -19,9 +23,21 @@ generateTargets :: Rules ()
generateTargets = action $ do generateTargets = action $ do
targets <- fmap concat . forM [Stage0 ..] $ \stage -> do targets <- fmap concat . forM [Stage0 ..] $ \stage -> do
pkgs <- interpret (stageTarget stage) getPackages pkgs <- interpret (stageTarget stage) getPackages
fmap concat . forM pkgs $ \pkg -> return fmap concat . forM pkgs $ \pkg -> do
[ targetPath stage pkg -/- "build/haskell.deps" let target = stagePackageTarget stage pkg
, targetPath stage pkg -/- "build/c.deps" ] buildPath = targetPath stage pkg -/- "build"
buildGhciLib <- interpret target $ getPkgData BuildGhciLib
pkgKey <- interpret target $ getPkgData PackageKey
let ghciLib = [ buildPath -/- "HS" ++ pkgKey <.> "o"
| buildGhciLib == "YES" && stage /= Stage0 ]
ways <- interpret target getWays
libs <- forM ways $ \way -> do
extension <- libsuf way
return $ buildPath -/- "libHS" ++ pkgKey <.> extension
return $ ghciLib ++ libs
need targets need targets
-- TODO: add Stage2 (compiler only?) -- TODO: add Stage2 (compiler only?)
......
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