Commit 709ffb71 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Merge Rules.Oracles into Rules

parent 4f0b5a13
......@@ -52,7 +52,6 @@ executable hadrian
, Rules.Install
, Rules.Libffi
, Rules.Library
, Rules.Oracles
, Rules.Perl
, Rules.Program
, Rules.Register
......
......@@ -60,4 +60,4 @@ sourcePath = hadrianPath -/- "src"
-- TODO: change @mk/config.h@ to @shake-build/cfg/config.h@
-- | Path to the generated @mk/config.h file.
configH :: FilePath
configH = "mk/config.h"
\ No newline at end of file
configH = "mk/config.h"
......@@ -7,7 +7,6 @@ import qualified Environment
import qualified Rules
import qualified Rules.Clean
import qualified Rules.Install
import qualified Rules.Oracles
import qualified Rules.SourceDist
import qualified Rules.Selftest
import qualified Rules.Test
......@@ -23,14 +22,14 @@ main = shakeArgsWith options CmdLineFlag.cmdFlags $ \cmdLineFlags targets -> do
where
rules :: Rules ()
rules = do
Rules.buildRules
Rules.Clean.cleanRules
Rules.Oracles.oracleRules
Rules.SourceDist.sourceDistRules
Rules.Install.installRules
Rules.oracleRules
Rules.Selftest.selftestRules
Rules.SourceDist.sourceDistRules
Rules.Test.testRules
Rules.buildRules
Rules.topLevelTargets
Rules.Install.installRules
options :: ShakeOptions
options = shakeOptions
{ shakeChange = ChangeModtimeAndDigest
......
module Rules (topLevelTargets, packageTargets, buildRules) where
module Rules (
buildRules, oracleRules, packageTargets, topLevelTargets
) where
import qualified Hadrian.Oracles.ArgsHash
import qualified Hadrian.Oracles.DirectoryContents
import qualified Hadrian.Oracles.KeyValue
import qualified Hadrian.Oracles.Path
import Base
import Context
import Expression
import Flavour
import GHC
import qualified Oracles.Dependencies
import qualified Oracles.ModuleFiles
import qualified Rules.Compile
import qualified Rules.Data
import qualified Rules.Dependencies
......@@ -18,9 +27,9 @@ import qualified Rules.Library
import qualified Rules.Perl
import qualified Rules.Program
import qualified Rules.Register
import Oracles.Dependencies
import Settings
import Settings.Path
import Target
allStages :: [Stage]
allStages = [minBound ..]
......@@ -52,7 +61,7 @@ packageTargets stage pkg = do
ways <- interpretInContext context getLibraryWays
libs <- mapM (pkgLibraryFile . Context stage pkg) ways
docs <- interpretInContext context $ buildHaddock flavour
more <- libraryTargets context
more <- Oracles.Dependencies.libraryTargets context
return $ [ pkgSetupConfigFile context | nonCabalContext context ]
++ [ pkgHaddockFile context | docs && stage == Stage1 ]
++ libs ++ more
......@@ -102,8 +111,17 @@ buildRules = do
packageRules
Rules.Perl.perlScriptRules
oracleRules :: Rules ()
oracleRules = do
Hadrian.Oracles.ArgsHash.argsHashOracle trackArgument getArgs
Hadrian.Oracles.DirectoryContents.directoryContentsOracle
Hadrian.Oracles.KeyValue.keyValueOracle
Hadrian.Oracles.Path.pathOracle
Oracles.Dependencies.dependenciesOracles
Oracles.ModuleFiles.moduleFilesOracle
programsStage1Only :: [Package]
programsStage1Only =
[ deriveConstants, genprimopcode, hp2ps, runGhc
, ghcCabal, hpc, dllSplit, ghcPkg, hsc2hs
, genapply, ghc ]
[ deriveConstants, genprimopcode, hp2ps, runGhc
, ghcCabal, hpc, dllSplit, ghcPkg, hsc2hs
, genapply, ghc ]
module Rules.Oracles (oracleRules) where
import qualified Hadrian.Oracles.ArgsHash
import qualified Hadrian.Oracles.DirectoryContents
import qualified Hadrian.Oracles.KeyValue
import qualified Hadrian.Oracles.Path
import Base
import qualified Oracles.Dependencies
import qualified Oracles.ModuleFiles
import Target
import Settings
oracleRules :: Rules ()
oracleRules = do
Hadrian.Oracles.ArgsHash.argsHashOracle trackArgument getArgs
Hadrian.Oracles.DirectoryContents.directoryContentsOracle
Hadrian.Oracles.KeyValue.keyValueOracle
Hadrian.Oracles.Path.pathOracle
Oracles.Dependencies.dependenciesOracles
Oracles.ModuleFiles.moduleFilesOracle
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