Commit 7792fbbe authored by Andrey Mokhov's avatar Andrey Mokhov

Minor revision

parent 1ade8854
......@@ -16,8 +16,8 @@ module Expression (
Context, vanillaContext, stageContext, Target,
-- * Convenient accessors
getBuildRoot, getBuildPath, getContext, getStage, getPackage, getBuilder,
getOutputs, getInputs, getWay, getInput, getOutput,
getBuildRoot, getBuildPath, getContext, getPkgData, getPkgDataList, getStage,
getPackage, getBuilder, getOutputs, getInputs, getWay, getInput, getOutput,
-- * Re-exports
module Base
......@@ -28,6 +28,7 @@ import Hadrian.Expression hiding (Expr, Predicate, Args)
import Base
import Context (Context, vanillaContext, stageContext, getBuildPath, getStage, getPackage, getWay)
import Oracles.PackageData
import Target hiding (builder, inputs, outputs)
-- | @Expr a@ is a computation that produces a value of type @Action a@ and can
......@@ -42,6 +43,14 @@ type Args = H.Args Context Builder
type Packages = Expr [Package]
type Ways = Expr [Way]
-- | Get a value from the @package-data.mk@ file of the current context.
getPkgData :: (FilePath -> PackageData) -> Expr String
getPkgData key = expr . pkgData . key =<< getBuildPath
-- | Get a list of values from the @package-data.mk@ file of the current context.
getPkgDataList :: (FilePath -> PackageDataList) -> Expr [String]
getPkgDataList key = expr . pkgDataList . key =<< getBuildPath
-- | Is the build currently in the provided stage?
stage :: Stage -> Predicate
stage s = (s ==) <$> getStage
......
......@@ -18,7 +18,7 @@ module GHC (
rtsContext, rtsBuildPath, rtsConfIn,
-- * Miscellaneous
ghcSplitPath, stripCmdPath, inplaceInstallPath
ghcSplitPath, stripCmdPath, inplaceInstallPath, buildDll0
) where
import Base
......@@ -192,3 +192,7 @@ rtsBuildPath = buildPath rtsContext
rtsConfIn :: FilePath
rtsConfIn = pkgPath rts -/- "package.conf.in"
buildDll0 :: Context -> Action Bool
buildDll0 Context {..} = do
windows <- windowsHost
return $ windows && stage == Stage1 && package == compiler
......@@ -13,8 +13,6 @@ import CommandLine
import Expression
import Flavour
import GHC
import Oracles.PackageData
import Oracles.Setting
import {-# SOURCE #-} Settings.Default
import Settings.Flavours.Development
import Settings.Flavours.Performance
......@@ -38,12 +36,6 @@ getPackages = expr flavour >>= packages
stagePackages :: Stage -> Action [Package]
stagePackages stage = interpretInContext (stageContext stage) getPackages
getPkgData :: (FilePath -> PackageData) -> Expr String
getPkgData key = expr . pkgData . key =<< getBuildPath
getPkgDataList :: (FilePath -> PackageDataList) -> Expr [String]
getPkgDataList key = expr . pkgDataList . key =<< getBuildPath
hadrianFlavours :: [Flavour]
hadrianFlavours =
[ defaultFlavour, developmentFlavour Stage1, developmentFlavour Stage2
......@@ -154,8 +146,3 @@ stage1Only = defaultStage1Only
-- | Install's DESTDIR setting.
destDir :: FilePath
destDir = defaultDestDir
buildDll0 :: Context -> Action Bool
buildDll0 Context {..} = do
windows <- windowsHost
return $ windows && stage == Stage1 && package == compiler
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