Commit 03b33797 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Move copyRules to Rules/Generate.hs, add missing generated dependencies.

parent f7cd3aee
......@@ -39,7 +39,6 @@ executable ghc-shake
, Rules.Cabal
, Rules.Compile
, Rules.Config
, Rules.Copy
, Rules.Data
, Rules.Dependencies
, Rules.Documentation
......
......@@ -3,7 +3,6 @@ import Rules
import Rules.Cabal
import Rules.Config
import Rules.Generate
import Rules.Copy
import Rules.Libffi
import Rules.IntegerGmp
import Rules.Oracles
......@@ -12,7 +11,7 @@ main :: IO ()
main = shakeArgs options $ do
cabalRules -- see Rules.Cabal
configRules -- see Rules.Config
copyRules -- see Rules.Copy
copyRules -- see Rules.Generate
generateTargets -- see Rules
generateRules -- see Rules.Generate
libffiRules -- see Rules.Libffi
......
......@@ -3,7 +3,7 @@ module Rules (generateTargets, packageRules) where
import Base
import Expression
import GHC
import Rules.Copy
import Rules.Generate
import Rules.Package
import Rules.Resources
import Settings
......
module Rules.Copy (installTargets, copyRules) where
import Base
import Expression
import GHC
import Rules.Actions
import Rules.Generate
installTargets :: [FilePath]
installTargets = [ "inplace/lib/template-hsc.h"
, "inplace/lib/platformConstants"
, "inplace/lib/settings" ]
copyRules :: Rules ()
copyRules = do
"inplace/lib/template-hsc.h" <~ pkgPath hsc2hs
"inplace/lib/platformConstants" <~ derivedConstantsPath
"inplace/lib/settings" <~ "."
where
file <~ dir = file %> \_ -> copyFile (dir -/- takeFileName file) file
module Rules.Generate (
generatePackageCode, generateRules,
derivedConstantsPath, generatedDependencies
derivedConstantsPath, generatedDependencies,
installTargets, copyRules
) where
import Base
......@@ -20,6 +21,11 @@ import Rules.Resources (Resources)
import Settings
import Settings.Builders.DeriveConstants
installTargets :: [FilePath]
installTargets = [ "inplace/lib/template-hsc.h"
, "inplace/lib/platformConstants"
, "inplace/lib/settings" ]
primopsSource :: FilePath
primopsSource = "compiler/prelude/primops.txt.pp"
......@@ -45,7 +51,7 @@ ghcPrimDependencies stage = ((targetPath stage ghcPrim -/- "build") -/-) <$>
, "autogen/GHC/Prim.hs" ]
derivedConstantsDependencies :: [FilePath]
derivedConstantsDependencies = (derivedConstantsPath -/-) <$>
derivedConstantsDependencies = installTargets ++ fmap (derivedConstantsPath -/-)
[ "DerivedConstants.h"
, "GHCConstantsHaskellType.hs"
, "GHCConstantsHaskellWrappers.hs"
......@@ -150,6 +156,14 @@ generatePackageCode _ target @ (PartialTarget stage pkg) =
copyFileChanged (pkgPath pkg -/- "runghc.hs") file
putSuccess $ "| Successfully generated '" ++ file ++ "'."
copyRules :: Rules ()
copyRules = do
"inplace/lib/template-hsc.h" <~ pkgPath hsc2hs
"inplace/lib/platformConstants" <~ derivedConstantsPath
"inplace/lib/settings" <~ "."
where
file <~ dir = file %> \_ -> copyFile (dir -/- takeFileName file) file
generateRules :: Rules ()
generateRules = do
"includes/ghcautoconf.h" <~ generateGhcAutoconfH
......
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