[commit: ghc] wip/nfs-locking: Add hiRule. (fae8451)
git at git.haskell.org
git at git.haskell.org
Thu Oct 26 23:22:13 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/fae8451a106cc2c298154d586201ce8924b9d701/ghc
>---------------------------------------------------------------
commit fae8451a106cc2c298154d586201ce8924b9d701
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Tue Jan 13 06:32:36 2015 +0000
Add hiRule.
>---------------------------------------------------------------
fae8451a106cc2c298154d586201ce8924b9d701
src/Package/Compile.hs | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/Package/Compile.hs b/src/Package/Compile.hs
index 760c96f..80835f8 100644
--- a/src/Package/Compile.hs
+++ b/src/Package/Compile.hs
@@ -29,8 +29,8 @@ suffixArgs way = arg ["-hisuf", hisuf way]
<> arg [ "-osuf", osuf way]
<> arg ["-hcsuf", hcsuf way]
-buildPackageCompile :: Package -> TodoItem -> Rules ()
-buildPackageCompile (Package name path _) (stage, dist, settings) =
+oRule :: Package -> TodoItem -> Rules ()
+oRule (Package name path _) (stage, dist, settings) =
let buildDir = path </> dist </> "build"
pkgData = path </> dist </> "package-data.mk"
depFile = buildDir </> name <.> "m"
@@ -54,3 +54,16 @@ buildPackageCompile (Package name path _) (stage, dist, settings) =
<> when (splitObjects stage) (arg "-split-objs")
<> arg ("-c":srcs)
<> arg ["-o", toStandard out]
+
+-- TODO: This rule looks a bit of a hack... combine it with the above?
+hiRule :: Package -> TodoItem -> Rules ()
+hiRule (Package name path _) (stage, dist, settings) =
+ let buildDir = path </> dist </> "build"
+ in
+ (buildDir <//> "*hi") %> \out -> do
+ let way = detectWay $ tail $ takeExtension out
+ oFile = out -<.> osuf way
+ need [oFile]
+
+buildPackageCompile :: Package -> TodoItem -> Rules ()
+buildPackageCompile = oRule <> hiRule
More information about the ghc-commits
mailing list