[commit: ghc] wip/nfs-locking: Add library targets. (e3e3c1d)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:03:16 UTC 2017


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

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

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

commit e3e3c1d6e03c1fd46af44afd5e29e7b1a4000093
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Fri Aug 7 02:57:05 2015 +0100

    Add library targets.


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

e3e3c1d6e03c1fd46af44afd5e29e7b1a4000093
 src/Rules.hs | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/Rules.hs b/src/Rules.hs
index be109f8..2509cf7 100644
--- a/src/Rules.hs
+++ b/src/Rules.hs
@@ -2,15 +2,19 @@ module Rules (
     oracleRules, cabalRules, configRules, packageRules, generateTargets
     ) where
 
+import Way
 import Base
 import Util
 import Stage
 import Expression
+import Oracles.PackageData
 import Rules.Cabal
 import Rules.Config
 import Rules.Package
 import Rules.Oracles
 import Rules.Resources
+import Settings.Ways
+import Settings.Util
 import Settings.Packages
 import Settings.TargetDirectory
 
@@ -19,9 +23,21 @@ generateTargets :: Rules ()
 generateTargets = action $ do
     targets <- fmap concat . forM [Stage0 ..] $ \stage -> do
         pkgs <- interpret (stageTarget stage) getPackages
-        fmap concat . forM pkgs $ \pkg -> return
-            [ targetPath stage pkg -/- "build/haskell.deps"
-            , targetPath stage pkg -/- "build/c.deps" ]
+        fmap concat . forM pkgs $ \pkg -> do
+            let target    = stagePackageTarget stage pkg
+                buildPath = targetPath stage pkg -/- "build"
+            buildGhciLib <- interpret target $ getPkgData BuildGhciLib
+            pkgKey       <- interpret target $ getPkgData PackageKey
+            let ghciLib = [ buildPath -/- "HS" ++ pkgKey <.> "o"
+                          | buildGhciLib == "YES" && stage /= Stage0 ]
+
+            ways <- interpret target getWays
+            libs <- forM ways $ \way -> do
+                extension <- libsuf way
+                return $ buildPath -/- "libHS" ++ pkgKey <.> extension
+
+            return $ ghciLib ++ libs
+
     need targets
 
 -- TODO: add Stage2 (compiler only?)



More information about the ghc-commits mailing list