Commit 423c5dd1 authored by Moritz Angermann's avatar Moritz Angermann
Browse files

Include PR Comments

parent b214918b
......@@ -55,6 +55,7 @@ executable ghc-shake
, Rules.Library
, Rules.Oracles
, Rules.Package
, Rules.Perl
, Rules.Program
, Rules.Resources
, Rules.Wrappers.Ghc
......
......@@ -113,12 +113,9 @@ defaultProgramPath stage pkg
| pkg == haddock || pkg == ghcTags = case stage of
Stage2 -> Just . inplaceProgram $ pkgNameString pkg
_ -> Nothing
| pkg == touchy = case stage of
| pkg `elem` [touchy, unlit] = case stage of
Stage0 -> Just $ "inplace/lib/bin" -/- pkgNameString pkg <.> exe
_ -> Nothing
| pkg == unlit = case stage of
Stage0 -> Just $ "inplace/lib" -/- pkgNameString pkg <.> exe
_ -> Nothing
| isProgram pkg = case stage of
Stage0 -> Just . inplaceProgram $ pkgNameString pkg
_ -> Just . installProgram $ pkgNameString pkg
......
......@@ -10,6 +10,7 @@ import qualified Rules.Generate
import qualified Rules.IntegerGmp
import qualified Rules.Libffi
import qualified Rules.Oracles
import qualified Rules.Perl
main :: IO ()
main = shakeArgs options rules
......@@ -19,7 +20,7 @@ main = shakeArgs options rules
, Rules.Config.configRules
, Rules.Generate.copyRules
, Rules.Generate.generateRules
, Rules.Generate.generateScripts
, Rules.Perl.perlScriptRules
, Rules.generateTargets
, Rules.IntegerGmp.integerGmpRules
, Rules.Libffi.libffiRules
......
module Rules.Generate (
generatePackageCode, generateRules, generateScripts,
derivedConstantsPath, generatedDependencies,
generate, generateExec, generatePackageCode, generateRules,
derivedConstantsPath, emptyTarget, generatedDependencies,
installTargets, copyRules
) where
......@@ -11,7 +11,6 @@ import Rules.Generators.ConfigHs
import Rules.Generators.GhcAutoconfH
import Rules.Generators.GhcBootPlatformH
import Rules.Generators.GhcPlatformH
import Rules.Generators.GhcSplit
import Rules.Generators.GhcVersionH
import Rules.Generators.VersionHs
import Oracles.ModuleFiles
......@@ -78,10 +77,11 @@ compilerDependencies stage =
, "primop-vector-tys-exports.hs-incl"
, "primop-vector-tycons.hs-incl"
, "primop-vector-tys.hs-incl" ]
++ ["inplace/lib/bin/ghc-split"]
generatedDependencies :: Stage -> Package -> [FilePath]
generatedDependencies stage pkg
| pkg == compiler = compilerDependencies stage ++ ["inplace/lib/bin/ghc-split"]
| pkg == compiler = compilerDependencies stage
| pkg == ghcPrim = ghcPrimDependencies stage
| pkg == rts = includesDependencies ++ derivedConstantsDependencies
| stage == Stage0 = defaultDependencies
......@@ -185,31 +185,6 @@ generateRules = do
where
file <~ gen = file %> \out -> generate out emptyTarget gen
-- | Generate scripts the build system requires. For now we generate the
-- @ghc-split@ script from it's literate perl source.
generateScripts :: Rules ()
generateScripts = do
-- how to translate literate perl to perl.
-- this is a hack :-/
"//*.prl" %> \out -> do
let src = out -<.> "lprl"
path <- builderPath Unlit
need [path]
unit $ cmd [path] [src] [out]
-- ghc-split is only a perl script.
let ghcSplit = "inplace/lib/ghc-split" -- See system.config
let ghcSplitBin = "inplace/lib/bin/ghc-split" -- See ConfigHs.hs
ghcSplit <~ generateGhcSplit
ghcSplitBin %> \out -> do
need [ghcSplit]
copyFileChanged ghcSplit out
where
file <~ gen = file %> \out -> generateExec out emptyTarget gen
-- TODO: Use the Types, Luke! (drop partial function)
-- We sometimes need to evaluate expressions that do not require knowing all
-- information about the target. In this case, we don't want to know anything.
......
......@@ -9,7 +9,7 @@ generateGhcSplit :: Expr String
generateGhcSplit = do
let yesNo = lift . fmap (\x -> if x then "YES" else "NO")
perl <- getBuilderPath Perl
let script = "driver" -/- "split" -/- "ghc-split.prl"
let script = "driver/split/ghc-split.prl"
when trackBuildSystem . lift $
need [sourcePath -/- "Rules" -/- "Generators" -/- "GhcSplit.hs"]
lift $ need [script]
......
module Rules.Perl (perlScriptRules) where
import Base
import Expression
import Rules.Actions (runBuilder)
import Rules.Generate (generateExec, emptyTarget)
import Rules.Generators.GhcSplit (generateGhcSplit)
-- | Generate scripts the build system requires. For now we generate the
-- @ghc-split@ script from it's literate perl source.
perlScriptRules :: Rules ()
perlScriptRules = do
-- how to translate literate perl to perl.
-- this is a hack :-/
"//*.prl" %> \out -> do
let src = out -<.> "lprl"
runBuilder Unlit [src, out]
-- ghc-split is only a perl script.
let ghcSplit = "inplace/lib/bin/ghc-split"
ghcSplit <~ generateGhcSplit
where
file <~ gen = file %> \out -> generateExec out emptyTarget gen
Supports Markdown
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