summaryrefslogtreecommitdiff
path: root/hadrian/src/Base.hs
diff options
context:
space:
mode:
Diffstat (limited to 'hadrian/src/Base.hs')
-rw-r--r--hadrian/src/Base.hs23
1 files changed, 8 insertions, 15 deletions
diff --git a/hadrian/src/Base.hs b/hadrian/src/Base.hs
index bc4eab354e..f7f1029d4e 100644
--- a/hadrian/src/Base.hs
+++ b/hadrian/src/Base.hs
@@ -23,7 +23,7 @@ module Base (
-- * Paths
hadrianPath, configPath, configFile, sourcePath, shakeFilesDir,
- generatedDir, generatedPath, stageBinPath, stageLibPath, templateHscPath,
+ stageBinPath, stageLibPath, templateHscPath,
ghcBinDeps, ghcLibDeps, includesDependencies, haddockDeps,
relativePackageDbPath, packageDbPath, packageDbStamp, mingwStamp,
) where
@@ -68,22 +68,14 @@ sourcePath = hadrianPath -/- "src"
configH :: FilePath
configH = "mk/config.h"
-ghcVersionH :: Action FilePath
-ghcVersionH = generatedPath <&> (-/- "ghcversion.h")
+ghcVersionH :: Stage -> Action FilePath
+ghcVersionH stage = stageLibPath stage <&> (-/- "ghcversion.h")
-- | The directory in 'buildRoot' containing the Shake database and other
-- auxiliary files generated by Hadrian.
shakeFilesDir :: FilePath
shakeFilesDir = "hadrian"
--- | The directory in 'buildRoot' containing generated source files that are not
--- package-specific, e.g. @ghcplatform.h@.
-generatedDir :: FilePath
-generatedDir = "generated"
-
-generatedPath :: Action FilePath
-generatedPath = buildRoot <&> (-/- generatedDir)
-
-- | Path to the package database for a given build stage, relative to the build
-- root.
relativePackageDbPath :: Stage -> FilePath
@@ -122,10 +114,11 @@ ghcBinDeps stage = mapM (\f -> stageLibPath stage <&> (-/- f))
, "ghci-usage.txt"
]
-includesDependencies :: Action [FilePath]
-includesDependencies = do
- path <- generatedPath
- return $ (path -/-) <$> [ "ghcautoconf.h", "ghcplatform.h", "ghcversion.h" ]
+includesDependencies :: Stage -> Action [FilePath]
+includesDependencies stage = do
+ p <- stageLibPath stage
+ pure $ (p -/-) <$>
+ [ "ghcautoconf.h", "ghcplatform.h", "ghcversion.h" ]
-- | Files the `haddock` binary depends on
haddockDeps :: Stage -> Action [FilePath]