Commit 56705eb7 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Rename builder arguments, fix #60.

parent 26cd11fb
......@@ -39,22 +39,22 @@ getArgs = fromDiffExpr $ defaultBuilderArgs <> defaultPackageArgs <> userArgs
-- TODO: is GhcHcOpts=-Rghc-timing needed?
defaultBuilderArgs :: Args
defaultBuilderArgs = mconcat
[ alexArgs
, arArgs
, deriveConstantsArgs
, gccArgs
, gccMArgs
, genPrimopCodeArgs
, ghcArgs
, ghcCabalArgs
, ghcCabalHsColourArgs
, ghcMArgs
, ghcPkgArgs
, haddockArgs
, happyArgs
, hsc2HsArgs
, hsCppArgs
, ldArgs ]
[ alexBuilderArgs
, arBuilderArgs
, deriveConstantsBuilderArgs
, gccBuilderArgs
, gccMBuilderArgs
, genPrimopCodeBuilderArgs
, ghcBuilderArgs
, ghcCabalBuilderArgs
, ghcCabalHsColourBuilderArgs
, ghcMBuilderArgs
, ghcPkgBuilderArgs
, haddockBuilderArgs
, happyBuilderArgs
, hsc2hsBuilderArgs
, hsCppBuilderArgs
, ldBuilderArgs ]
defaultPackageArgs :: Args
defaultPackageArgs = mconcat
......
module Settings.Builders.Alex (alexArgs) where
module Settings.Builders.Alex (alexBuilderArgs) where
import Expression
import Predicates (builder)
alexArgs :: Args
alexArgs = builder Alex ? mconcat [ arg "-g"
, arg =<< getInput
, arg "-o", arg =<< getOutput ]
alexBuilderArgs :: Args
alexBuilderArgs = builder Alex ? mconcat [ arg "-g"
, arg =<< getInput
, arg "-o", arg =<< getOutput ]
module Settings.Builders.Ar (arArgs, arCmd) where
module Settings.Builders.Ar (arBuilderArgs, arCmd) where
import Base
import Expression
import Oracles
import Predicates (builder)
arArgs :: Args
arArgs = builder Ar ? mconcat [ arg "q"
, arg =<< getOutput
, append =<< getInputs ]
arBuilderArgs :: Args
arBuilderArgs = builder Ar ? mconcat [ arg "q"
, arg =<< getOutput
, append =<< getInputs ]
-- This count includes arg "q" and arg file parameters in arArgs (see above).
-- Update this value appropriately when changing arArgs.
-- This count includes arg "q" and arg file parameters in arBuilderArgs.
-- Update this value appropriately when changing arBuilderArgs.
arFlagsCount :: Int
arFlagsCount = 2
......
module Settings.Builders.DeriveConstants (
derivedConstantsPath, deriveConstantsArgs
derivedConstantsPath, deriveConstantsBuilderArgs
) where
import Base
......@@ -13,8 +13,8 @@ derivedConstantsPath :: FilePath
derivedConstantsPath = "includes/dist-derivedconstants/header"
-- TODO: do we need to support `includes_CC_OPTS += -DDYNAMIC_BY_DEFAULT`?
deriveConstantsArgs :: Args
deriveConstantsArgs = builder DeriveConstants ? do
deriveConstantsBuilderArgs :: Args
deriveConstantsBuilderArgs = builder DeriveConstants ? do
cFlags <- fromDiffExpr includeCcArgs
mconcat
[ file "//DerivedConstants.h" ? arg "--gen-header"
......
module Settings.Builders.Gcc (gccArgs, gccMArgs) where
module Settings.Builders.Gcc (gccBuilderArgs, gccMBuilderArgs) where
import Development.Shake.FilePath
import Expression
......@@ -7,15 +7,15 @@ import Predicates (stagedBuilder)
import Settings
import Settings.Builders.Common (cIncludeArgs)
gccArgs :: Args
gccArgs = stagedBuilder Gcc ?
gccBuilderArgs :: Args
gccBuilderArgs = stagedBuilder Gcc ?
mconcat [ commonGccArgs
, arg "-c", arg =<< getInput
, arg "-o", arg =<< getOutput ]
-- TODO: handle custom $1_$2_MKDEPENDC_OPTS and
gccMArgs :: Args
gccMArgs = stagedBuilder GccM ? do
gccMBuilderArgs :: Args
gccMBuilderArgs = stagedBuilder GccM ? do
output <- getOutput
mconcat [ arg "-E"
, arg "-MM"
......
module Settings.Builders.GenPrimopCode (genPrimopCodeArgs) where
module Settings.Builders.GenPrimopCode (genPrimopCodeBuilderArgs) where
import Expression
import Predicates (builder, file)
-- Stdin/stdout are handled in a special way. See Rules/Actions.hs.
genPrimopCodeArgs :: Args
genPrimopCodeArgs = builder GenPrimopCode ? mconcat
genPrimopCodeBuilderArgs :: Args
genPrimopCodeBuilderArgs = builder GenPrimopCode ? mconcat
[ file "//PrimopWrappers.hs" ? arg "--make-haskell-wrappers"
, file "//Prim.hs" ? arg "--make-haskell-source"
, file "//primop-data-decl.hs-incl" ? arg "--data-decl"
......
module Settings.Builders.Ghc (ghcArgs, ghcMArgs, commonGhcArgs) where
module Settings.Builders.Ghc (ghcBuilderArgs, ghcMBuilderArgs, commonGhcArgs) where
import Base
import Expression
......@@ -13,8 +13,8 @@ import Settings.Builders.Common (cIncludeArgs)
-- $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
-- $$(if $$(findstring YES,$$($1_$2_DYNAMIC_TOO)),-dyno
-- $$(addsuffix .$$(dyn_osuf)-boot,$$(basename $$@)))
ghcArgs :: Args
ghcArgs = stagedBuilder Ghc ? do
ghcBuilderArgs :: Args
ghcBuilderArgs = stagedBuilder Ghc ? do
output <- getOutput
way <- getWay
pkg <- getPackage
......@@ -35,8 +35,8 @@ ghcArgs = stagedBuilder Ghc ? do
, append =<< getInputs
, arg "-o", arg =<< getOutput ]
ghcMArgs :: Args
ghcMArgs = stagedBuilder GhcM ? do
ghcMBuilderArgs :: Args
ghcMBuilderArgs = stagedBuilder GhcM ? do
ways <- getWays
mconcat [ arg "-M"
, commonGhcArgs
......@@ -45,7 +45,7 @@ ghcMArgs = stagedBuilder GhcM ? do
, append $ concat [ ["-dep-suffix", wayPrefix w] | w <- ways ]
, append =<< getInputs ]
-- This is included into ghcArgs, ghcMArgs and haddockArgs
-- This is included into ghcBuilderArgs, ghcMBuilderArgs and haddockBuilderArgs
commonGhcArgs :: Args
commonGhcArgs = do
way <- getWay
......
module Settings.Builders.GhcCabal (
ghcCabalArgs, ghcCabalHsColourArgs, bootPackageDbArgs, cppArgs, needDll0
ghcCabalBuilderArgs, ghcCabalHsColourBuilderArgs,
bootPackageDbArgs, cppArgs, needDll0
) where
import Base
......@@ -15,8 +16,8 @@ import Predicates hiding (stage)
import Settings
import Settings.Builders.Common
ghcCabalArgs :: Args
ghcCabalArgs = builder GhcCabal ? do
ghcCabalBuilderArgs :: Args
ghcCabalBuilderArgs = builder GhcCabal ? do
path <- getPackagePath
dir <- getTargetDirectory
mconcat [ arg "configure"
......@@ -36,8 +37,8 @@ ghcCabalArgs = builder GhcCabal ? do
, with Alex
, with Happy ]
ghcCabalHsColourArgs :: Args
ghcCabalHsColourArgs = builder GhcCabalHsColour ? do
ghcCabalHsColourBuilderArgs :: Args
ghcCabalHsColourBuilderArgs = builder GhcCabalHsColour ? do
path <- getPackagePath
dir <- getTargetDirectory
mconcat [ arg "hscolour"
......
module Settings.Builders.GhcPkg (ghcPkgArgs) where
module Settings.Builders.GhcPkg (ghcPkgBuilderArgs) where
import Base
import Builder
......@@ -7,8 +7,8 @@ import Predicates
import Settings
import Settings.Builders.GhcCabal
ghcPkgArgs :: Args
ghcPkgArgs = stagedBuilder GhcPkg ? (initArgs <> updateArgs)
ghcPkgBuilderArgs :: Args
ghcPkgBuilderArgs = stagedBuilder GhcPkg ? (initArgs <> updateArgs)
initPredicate :: Predicate
initPredicate = orM $ map (file . packageConfiguration) [Stage0 ..]
......
module Settings.Builders.Haddock (haddockArgs) where
module Settings.Builders.Haddock (haddockBuilderArgs) where
import Development.Shake.FilePath
import Base
......@@ -10,8 +10,8 @@ import Predicates hiding (file)
import Settings
import Settings.Builders.Ghc
haddockArgs :: Args
haddockArgs = builder Haddock ? do
haddockBuilderArgs :: Args
haddockBuilderArgs = builder Haddock ? do
output <- getOutput
pkg <- getPackage
path <- getTargetPath
......
module Settings.Builders.Happy (happyArgs) where
module Settings.Builders.Happy (happyBuilderArgs) where
import Expression
import Predicates (builder)
happyArgs :: Args
happyArgs = builder Happy ? mconcat [ arg "-agc"
, arg "--strict"
, arg =<< getInput
, arg "-o", arg =<< getOutput ]
happyBuilderArgs :: Args
happyBuilderArgs = builder Happy ? mconcat [ arg "-agc"
, arg "--strict"
, arg =<< getInput
, arg "-o", arg =<< getOutput ]
module Settings.Builders.HsCpp (hsCppArgs) where
module Settings.Builders.HsCpp (hsCppBuilderArgs) where
import Expression
import Oracles
import Predicates (builder)
import Settings.Builders.GhcCabal
hsCppArgs :: Args
hsCppArgs = builder HsCpp ? do
hsCppBuilderArgs :: Args
hsCppBuilderArgs = builder HsCpp ? do
stage <- getStage
mconcat [ append =<< getSettingList HsCppArgs
, arg "-P"
......
module Settings.Builders.Hsc2Hs (hsc2HsArgs) where
module Settings.Builders.Hsc2Hs (hsc2hsBuilderArgs) where
import Control.Monad.Trans.Class
import Control.Monad.Extra
......@@ -13,8 +13,8 @@ import Settings.Builders.Common
templateHsc :: FilePath
templateHsc = "inplace/lib/template-hsc.h"
hsc2HsArgs :: Args
hsc2HsArgs = builder Hsc2Hs ? do
hsc2hsBuilderArgs :: Args
hsc2hsBuilderArgs = builder Hsc2Hs ? do
stage <- getStage
ccPath <- lift . builderPath $ Gcc stage
gmpDirs <- getSettingList GmpIncludeDirs
......
module Settings.Builders.Ld (ldArgs) where
module Settings.Builders.Ld (ldBuilderArgs) where
import Expression
import Oracles
import Predicates (builder)
ldArgs :: Args
ldArgs = builder Ld ? do
ldBuilderArgs :: Args
ldBuilderArgs = builder Ld ? do
args <- getSettingList . ConfLdLinkerArgs =<< getStage
mconcat [ append args
, arg "-r"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment