[commit: ghc] wip/nfs-locking: Implement new build rule: buildPackageLibrary. (2143dce)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:05:04 UTC 2017


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

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

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

commit 2143dce721122b3e9e0b08fb4691160305f0ba99
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Jan 13 02:30:01 2015 +0000

    Implement new build rule: buildPackageLibrary.


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

2143dce721122b3e9e0b08fb4691160305f0ba99
 src/Package/Library.hs | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/Package/Library.hs b/src/Package/Library.hs
new file mode 100644
index 0000000..9598b1a
--- /dev/null
+++ b/src/Package/Library.hs
@@ -0,0 +1,25 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+module Package.Library (buildPackageLibrary) where
+
+import Package.Base
+
+{- "/usr/bin/ar" q  
+libraries/deepseq/dist-install/build/libHSdeeps_FT5iVCELxOr62eHY0nbvnU.a
+ at libraries/deepseq/dist-install/build/libHSdeeps_FT5iVCELxOr62eHY0nbvnU.a.contents
+-}
+
+--  "$$(XARGS)" $$(XARGS_OPTS) "$$($1_$2_AR)" $$($1_$2_AR_OPTS) $$($1_$2_EXTRA_AR_ARGS) $$@ < $$@.contents
+-- AR_OPTS            = $(SRC_AR_OPTS) $(WAY$(_way)_AR_OPTS) $(EXTRA_AR_OPTS)
+
+buildPackageLibrary :: Package -> TodoItem -> Rules ()
+buildPackageLibrary (Package _ path _) (stage, dist, _) =
+    let buildDir = path </> dist </> "build"
+        pkgData  = path </> dist </> "package-data.mk"
+    in
+    (buildDir <//> "*a") %> \out -> do
+        let way = detectWay $ tail $ takeExtension out
+        need ["shake/src/Package/Library.hs"]
+        depObjs <- pkgDepObjects path dist way
+        need depObjs
+        libObjs <- pkgLibObjects path dist stage way
+        terseRun Ar $ arArgs <+> out <+> libObjs



More information about the ghc-commits mailing list