summaryrefslogtreecommitdiff
path: root/hadrian/src/Settings/Builders/Make.hs
blob: cc350df5087795c04825006131eff0dcc1ed851f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Settings.Builders.Make (makeBuilderArgs) where

import Rules.Gmp
import Rules.Libffi
import Settings.Builders.Common

makeBuilderArgs :: Args
makeBuilderArgs = do
    threads    <- shakeThreads <$> expr getShakeOptions
    gmpPath    <- expr gmpBuildPath
    libffiPath <- expr libffiBuildPath
    let t = show $ max 4 (threads - 2) -- Don't use all Shake's threads
    mconcat
        [ builder (Make gmpPath          ) ? pure ["MAKEFLAGS=-j" ++ t]
        , builder (Make libffiPath       ) ? pure ["MAKEFLAGS=-j" ++ t, "install"]
        , builder (Make "testsuite/tests") ? pure ["THREADS=" ++ t, "fast"] ]