[commit: ghc] wip/nfs-locking: Add install targets, install inplace/lib/platformConstants. (43b6cc3)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:31:11 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/43b6cc390adbf439e8b98c19eb8b9196f0a58bfb/ghc

>---------------------------------------------------------------

commit 43b6cc390adbf439e8b98c19eb8b9196f0a58bfb
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Dec 27 02:13:55 2015 +0000

    Add install targets, install inplace/lib/platformConstants.


>---------------------------------------------------------------

43b6cc390adbf439e8b98c19eb8b9196f0a58bfb
 src/Rules.hs          |  4 +++-
 src/Rules/Generate.hs |  3 ++-
 src/Rules/Install.hs  | 16 ++++++++++++----
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/Rules.hs b/src/Rules.hs
index 5516c33..a9ac3e4 100644
--- a/src/Rules.hs
+++ b/src/Rules.hs
@@ -1,6 +1,7 @@
 module Rules (generateTargets, packageRules) where
 
 import Expression
+import Rules.Install
 import Rules.Package
 import Rules.Resources
 import Settings
@@ -18,7 +19,8 @@ generateTargets = action $ do
             return [ pkgHaddockFile pkg | needHaddock && stage == Stage1 ]
         let programTargets = [ prog | Just prog <- programPath stage <$> pkgs ]
         return $ libTargets ++ programTargets
-    need targets
+
+    need $ targets ++ installTargets
 
 packageRules :: Rules ()
 packageRules = do
diff --git a/src/Rules/Generate.hs b/src/Rules/Generate.hs
index 2121a9c..ccd059f 100644
--- a/src/Rules/Generate.hs
+++ b/src/Rules/Generate.hs
@@ -1,5 +1,6 @@
 module Rules.Generate (
-    generatePackageCode, generateRules, includesDependencies
+    generatePackageCode, generateRules,
+    derivedConstantsPath, includesDependencies
     ) where
 
 import Expression
diff --git a/src/Rules/Install.hs b/src/Rules/Install.hs
index b592728..fca88fe 100644
--- a/src/Rules/Install.hs
+++ b/src/Rules/Install.hs
@@ -1,11 +1,19 @@
-module Rules.Install (installRules) where
+module Rules.Install (installTargets, installRules) where
 
 import Expression
 import GHC
+import Rules.Generate
+
+installTargets :: [FilePath]
+installTargets = [ "inplace/lib/template-hsc.h"
+                 , "inplace/lib/platformConstants" ]
 
 installRules :: Rules ()
 installRules = do
-    "inplace/lib/template-hsc.h" %> \out -> do
-        let source = pkgPath hsc2hs -/- "template-hsc.h"
-        putBuild $ "| Copying " ++ source ++ " -> " ++ out
+    "inplace/lib/template-hsc.h"    <~ pkgPath hsc2hs
+    "inplace/lib/platformConstants" <~ derivedConstantsPath
+  where
+    file <~ dir = file %> \out -> do
+        let source = dir -/- takeFileName out
         copyFileChanged source out
+        putSuccess $ "| Installed " ++ source ++ " -> " ++ out



More information about the ghc-commits mailing list