Run Make builder with -jN using N = shakeThreads
authorAndrey Mokhov <andrey.mokhov@gmail.com>
Sun, 22 May 2016 00:22:19 +0000 (01:22 +0100)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Sun, 22 May 2016 00:22:19 +0000 (01:22 +0100)
src/Settings/Builders/Make.hs

index 6968cd0..3d06775 100644 (file)
@@ -1,10 +1,14 @@
 module Settings.Builders.Make (makeBuilderArgs) where
 
+import Base
 import Predicate
 import Settings
 
 makeBuilderArgs :: Args
-makeBuilderArgs = mconcat
-    [ builder (Make gmpBuildPath     ) ? arg "MAKEFLAGS="
-    , builder (Make libffiBuildPath  ) ? append ["MAKEFLAGS=", "install"]
-    , builder (Make "testsuite/tests") ? arg "fast" ]
+makeBuilderArgs = do
+    threads <- shakeThreads <$> lift getShakeOptions
+    let j = "-j" ++ show threads
+    mconcat
+        [ builder (Make gmpBuildPath     ) ? append ["MAKEFLAGS=" ++ j]
+        , builder (Make libffiBuildPath  ) ? append ["MAKEFLAGS=" ++ j, "install"]
+        , builder (Make "testsuite/tests") ? arg "fast" ]