[commit: ghc] wip/nfs-locking: Generate targets from package list. (5c01b64)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:22:53 UTC 2017


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

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

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

commit 5c01b64cff13863a0c3dc34a63352b7214245a72
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Jan 13 13:03:48 2015 +0000

    Generate targets from package list.


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

5c01b64cff13863a0c3dc34a63352b7214245a72
 src/Package.hs | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/Package.hs b/src/Package.hs
index 899e48a..217c05a 100644
--- a/src/Package.hs
+++ b/src/Package.hs
@@ -25,18 +25,20 @@ buildPackage = buildPackageData
 packageRules :: Rules ()
 packageRules = do
     -- TODO: control targets from commang line arguments
-    want [ "libraries/deepseq/dist-install/build/libHSdeeps_FT5iVCELxOr62eHY0nbvnU.a"
-         , "libraries/deepseq/dist-install/build/libHSdeeps_FT5iVCELxOr62eHY0nbvnU.p_a"
-         , "libraries/deepseq/dist-install/build/HSdeeps_FT5iVCELxOr62eHY0nbvnU.o"
-         , "libraries/array/dist-install/build/libHSarray_3w0nMK0JfaFJPpLFn2yWAJ.a"
-         , "libraries/array/dist-install/build/libHSarray_3w0nMK0JfaFJPpLFn2yWAJ.p_a"
-         , "libraries/array/dist-install/build/HSarray_3w0nMK0JfaFJPpLFn2yWAJ.o"
-         , "libraries/bin-package-db/dist-install/build/libHSbinpa_9qPPbdABQ6HK3eua2jBtib.a"
-         , "libraries/bin-package-db/dist-install/build/libHSbinpa_9qPPbdABQ6HK3eua2jBtib.p_a"
-         , "libraries/bin-package-db/dist-install/build/HSbinpa_9qPPbdABQ6HK3eua2jBtib.o"
-         , "libraries/binary/dist-install/build/HSbinar_8WpSY1EWq5j1AwY619xVVw.o"
-         , "libraries/binary/dist-install/build/libHSbinar_8WpSY1EWq5j1AwY619xVVw.a"
-         , "libraries/binary/dist-install/build/libHSbinar_8WpSY1EWq5j1AwY619xVVw.p_a" ]
-    forM_ packages $ \pkg -> do
-        forM_ (pkgTodo pkg) $ \todoItem -> do
+    forM_ packages $ \pkg @ (Package name path todo) -> do
+        forM_ todo $ \todoItem @ (stage, dist, settings) -> do
+
+            -- Want top .o and .a files for the pkg/todo combo:
+            action $ do
+                let buildDir = path </> dist </> "build"
+                    pkgData  = path </> dist </> "package-data.mk"
+                [key] <- arg (PackageKey pkgData)
+                let oFile = buildDir </> "Hs" ++ key <.> "o"
+                ways'  <- ways settings
+                aFiles <- forM ways' $ \way -> do
+                    extension <- libsuf way
+                    return $ buildDir </> "libHs" ++ key <.> extension
+                need $ [oFile] ++ aFiles
+
+            -- Build rules for the package
             buildPackage pkg todoItem



More information about the ghc-commits mailing list