Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
56705eb7
Commit
56705eb7
authored
Jan 01, 2016
by
Andrey Mokhov
Browse files
Rename builder arguments, fix
#60
.
parent
26cd11fb
Changes
14
Hide whitespace changes
Inline
Side-by-side
src/Settings/Args.hs
View file @
56705eb7
...
...
@@ -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
,
hsc2
Hs
Args
,
hsCppArgs
,
ldArgs
]
[
alex
Builder
Args
,
ar
Builder
Args
,
deriveConstants
Builder
Args
,
gcc
Builder
Args
,
gccM
Builder
Args
,
genPrimopCode
Builder
Args
,
ghc
Builder
Args
,
ghcCabal
Builder
Args
,
ghcCabalHsColour
Builder
Args
,
ghcM
Builder
Args
,
ghcPkg
Builder
Args
,
haddock
Builder
Args
,
happy
Builder
Args
,
hsc2
hsBuilder
Args
,
hsCpp
Builder
Args
,
ld
Builder
Args
]
defaultPackageArgs
::
Args
defaultPackageArgs
=
mconcat
...
...
src/Settings/Builders/Alex.hs
View file @
56705eb7
module
Settings.Builders.Alex
(
alexArgs
)
where
module
Settings.Builders.Alex
(
alex
Builder
Args
)
where
import
Expression
import
Predicates
(
builder
)
alexArgs
::
Args
alexArgs
=
builder
Alex
?
mconcat
[
arg
"-g"
,
arg
=<<
getInput
,
arg
"-o"
,
arg
=<<
getOutput
]
alex
Builder
Args
::
Args
alex
Builder
Args
=
builder
Alex
?
mconcat
[
arg
"-g"
,
arg
=<<
getInput
,
arg
"-o"
,
arg
=<<
getOutput
]
src/Settings/Builders/Ar.hs
View file @
56705eb7
module
Settings.Builders.Ar
(
arArgs
,
arCmd
)
where
module
Settings.Builders.Ar
(
ar
Builder
Args
,
arCmd
)
where
import
Base
import
Expression
import
Oracles
import
Predicates
(
builder
)
arArgs
::
Args
arArgs
=
builder
Ar
?
mconcat
[
arg
"q"
,
arg
=<<
getOutput
,
append
=<<
getInputs
]
ar
Builder
Args
::
Args
ar
Builder
Args
=
builder
Ar
?
mconcat
[
arg
"q"
,
arg
=<<
getOutput
,
append
=<<
getInputs
]
-- This count includes arg "q" and arg file parameters in ar
Args (see above)
.
-- Update this value appropriately when changing arArgs.
-- This count includes arg "q" and arg file parameters in ar
BuilderArgs
.
-- Update this value appropriately when changing ar
Builder
Args.
arFlagsCount
::
Int
arFlagsCount
=
2
...
...
src/Settings/Builders/DeriveConstants.hs
View file @
56705eb7
module
Settings.Builders.DeriveConstants
(
derivedConstantsPath
,
deriveConstantsArgs
derivedConstantsPath
,
deriveConstants
Builder
Args
)
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
deriveConstants
Builder
Args
::
Args
deriveConstants
Builder
Args
=
builder
DeriveConstants
?
do
cFlags
<-
fromDiffExpr
includeCcArgs
mconcat
[
file
"//DerivedConstants.h"
?
arg
"--gen-header"
...
...
src/Settings/Builders/Gcc.hs
View file @
56705eb7
module
Settings.Builders.Gcc
(
gccArgs
,
gccMArgs
)
where
module
Settings.Builders.Gcc
(
gcc
Builder
Args
,
gccM
Builder
Args
)
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
?
gcc
Builder
Args
::
Args
gcc
Builder
Args
=
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
gccM
Builder
Args
::
Args
gccM
Builder
Args
=
stagedBuilder
GccM
?
do
output
<-
getOutput
mconcat
[
arg
"-E"
,
arg
"-MM"
...
...
src/Settings/Builders/GenPrimopCode.hs
View file @
56705eb7
module
Settings.Builders.GenPrimopCode
(
genPrimopCodeArgs
)
where
module
Settings.Builders.GenPrimopCode
(
genPrimopCode
Builder
Args
)
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
genPrimopCode
Builder
Args
::
Args
genPrimopCode
Builder
Args
=
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"
...
...
src/Settings/Builders/Ghc.hs
View file @
56705eb7
module
Settings.Builders.Ghc
(
ghcArgs
,
ghcMArgs
,
commonGhcArgs
)
where
module
Settings.Builders.Ghc
(
ghc
Builder
Args
,
ghcM
Builder
Args
,
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
ghc
Builder
Args
::
Args
ghc
Builder
Args
=
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
ghcM
Builder
Args
::
Args
ghcM
Builder
Args
=
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 ghc
Builder
Args, ghcM
Builder
Args and haddock
Builder
Args
commonGhcArgs
::
Args
commonGhcArgs
=
do
way
<-
getWay
...
...
src/Settings/Builders/GhcCabal.hs
View file @
56705eb7
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
ghcCabal
Builder
Args
::
Args
ghcCabal
Builder
Args
=
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
ghcCabalHsColour
Builder
Args
::
Args
ghcCabalHsColour
Builder
Args
=
builder
GhcCabalHsColour
?
do
path
<-
getPackagePath
dir
<-
getTargetDirectory
mconcat
[
arg
"hscolour"
...
...
src/Settings/Builders/GhcPkg.hs
View file @
56705eb7
module
Settings.Builders.GhcPkg
(
ghcPkgArgs
)
where
module
Settings.Builders.GhcPkg
(
ghcPkg
Builder
Args
)
where
import
Base
import
Builder
...
...
@@ -7,8 +7,8 @@ import Predicates
import
Settings
import
Settings.Builders.GhcCabal
ghcPkgArgs
::
Args
ghcPkgArgs
=
stagedBuilder
GhcPkg
?
(
initArgs
<>
updateArgs
)
ghcPkg
Builder
Args
::
Args
ghcPkg
Builder
Args
=
stagedBuilder
GhcPkg
?
(
initArgs
<>
updateArgs
)
initPredicate
::
Predicate
initPredicate
=
orM
$
map
(
file
.
packageConfiguration
)
[
Stage0
..
]
...
...
src/Settings/Builders/Haddock.hs
View file @
56705eb7
module
Settings.Builders.Haddock
(
haddockArgs
)
where
module
Settings.Builders.Haddock
(
haddock
Builder
Args
)
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
haddock
Builder
Args
::
Args
haddock
Builder
Args
=
builder
Haddock
?
do
output
<-
getOutput
pkg
<-
getPackage
path
<-
getTargetPath
...
...
src/Settings/Builders/Happy.hs
View file @
56705eb7
module
Settings.Builders.Happy
(
happyArgs
)
where
module
Settings.Builders.Happy
(
happy
Builder
Args
)
where
import
Expression
import
Predicates
(
builder
)
happyArgs
::
Args
happyArgs
=
builder
Happy
?
mconcat
[
arg
"-agc"
,
arg
"--strict"
,
arg
=<<
getInput
,
arg
"-o"
,
arg
=<<
getOutput
]
happy
Builder
Args
::
Args
happy
Builder
Args
=
builder
Happy
?
mconcat
[
arg
"-agc"
,
arg
"--strict"
,
arg
=<<
getInput
,
arg
"-o"
,
arg
=<<
getOutput
]
src/Settings/Builders/HsCpp.hs
View file @
56705eb7
module
Settings.Builders.HsCpp
(
hsCppArgs
)
where
module
Settings.Builders.HsCpp
(
hsCpp
Builder
Args
)
where
import
Expression
import
Oracles
import
Predicates
(
builder
)
import
Settings.Builders.GhcCabal
hsCppArgs
::
Args
hsCppArgs
=
builder
HsCpp
?
do
hsCpp
Builder
Args
::
Args
hsCpp
Builder
Args
=
builder
HsCpp
?
do
stage
<-
getStage
mconcat
[
append
=<<
getSettingList
HsCppArgs
,
arg
"-P"
...
...
src/Settings/Builders/Hsc2Hs.hs
View file @
56705eb7
module
Settings.Builders.Hsc2Hs
(
hsc2
Hs
Args
)
where
module
Settings.Builders.Hsc2Hs
(
hsc2
hsBuilder
Args
)
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"
hsc2
Hs
Args
::
Args
hsc2
Hs
Args
=
builder
Hsc2Hs
?
do
hsc2
hsBuilder
Args
::
Args
hsc2
hsBuilder
Args
=
builder
Hsc2Hs
?
do
stage
<-
getStage
ccPath
<-
lift
.
builderPath
$
Gcc
stage
gmpDirs
<-
getSettingList
GmpIncludeDirs
...
...
src/Settings/Builders/Ld.hs
View file @
56705eb7
module
Settings.Builders.Ld
(
ldArgs
)
where
module
Settings.Builders.Ld
(
ld
Builder
Args
)
where
import
Expression
import
Oracles
import
Predicates
(
builder
)
ldArgs
::
Args
ldArgs
=
builder
Ld
?
do
ld
Builder
Args
::
Args
ld
Builder
Args
=
builder
Ld
?
do
args
<-
getSettingList
.
ConfLdLinkerArgs
=<<
getStage
mconcat
[
append
args
,
arg
"-r"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment