Commit 45d41a56 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add new builder HsCpp.

parent 90301e1b
......@@ -23,6 +23,8 @@ hsc2hs = @hardtop@/inplace/bin/hsc2hs
genprimopcode = @hardtop@/inplace/bin/genprimopcode
hs-cpp = @HaskellCPPCmd@ @HaskellCPPArgs@
unlit = @hardtop@/inplace/lib/unlit
ghc-split = @hardtop@/inplace/lib/ghc-split
......
......@@ -30,6 +30,7 @@ data Builder = Alex
| Haddock
| Happy
| HsColour
| HsCpp
| Hsc2Hs
| Ld
| Unlit
......@@ -58,6 +59,7 @@ builderKey builder = case builder of
Haddock -> "haddock"
HsColour -> "hscolour"
Hsc2Hs -> "hsc2hs"
HsCpp -> "hs-cpp"
Ld -> "ld"
Unlit -> "unlit"
......
......@@ -32,6 +32,11 @@ buildWithResources rs target = do
forM_ (chunksOfSize maxChunk remainingArgs) $ \argsChunk ->
unit . cmd [path] $ persistentArgs ++ argsChunk
HsCpp -> do
let file = head $ Target.files target -- TODO: ugly
Stdout output <- cmd [path] argList
writeFileChanged file output
GenPrimopCode -> do
let src = head $ Target.sources target -- TODO: ugly
file = head $ Target.files target
......
......@@ -11,6 +11,7 @@ import Settings.Builders.GhcPkg
import Settings.Builders.Haddock
import Settings.Builders.Happy
import Settings.Builders.Hsc2Hs
import Settings.Builders.HsCpp
import Settings.Builders.Ld
import Settings.User
......@@ -41,4 +42,5 @@ defaultArgs = mconcat
, haddockArgs
, happyArgs
, hsc2HsArgs
, hsCppArgs
, ldArgs ]
module Settings.Builders.GhcCabal (
cabalArgs, ghcCabalHsColourArgs, bootPackageDbArgs, customPackageArgs,
ccArgs, ccWarnings, argStagedSettingList
ccArgs, cppArgs, ccWarnings, argStagedSettingList
) where
import Expression
......
module Settings.Builders.HsCpp (hsCppArgs) where
import Expression
import Predicates (builder)
import Settings.Builders.GhcCabal
-- TODO: why process the result with grep -v '^#pragma GCC'? No such lines!
hsCppArgs :: Args
hsCppArgs = builder HsCpp ? do
stage <- getStage
src <- getSource
mconcat [ arg "-P"
, cppArgs
, arg $ "-Icompiler/stage" ++ show stage
, arg "-x"
, arg "c"
, arg src ]
......@@ -4,7 +4,7 @@ import Expression
import Oracles
import Predicates (builder, stage0, notStage0)
import Settings
import Settings.Builders.GhcCabal
import Settings.Builders.GhcCabal hiding (cppArgs)
hsc2HsArgs :: Args
hsc2HsArgs = builder Hsc2Hs ? do
......
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