Commit 64ae7fe8 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Drop experimental code for #174.

parent 7bc48677
......@@ -12,21 +12,9 @@ compilePackage :: [(Resource, Int)] -> Context -> Rules ()
compilePackage rs context@Context {..} = do
let path = buildPath context
path <//> "*" <.> hisuf way %> \hi ->
if compileInterfaceFilesSeparately
then do
(src, deps) <- dependencies path $ hi -<.> osuf way
need $ src : deps
buildWithResources rs $ Target context (Ghc Compile stage) [src] [hi]
else need [ hi -<.> osuf way ]
path <//> "*" <.> hisuf way %> \hi -> need [ hi -<.> osuf way ]
path <//> "*" <.> hibootsuf way %> \hiboot ->
if compileInterfaceFilesSeparately
then do
(src, deps) <- dependencies path $ hiboot -<.> obootsuf way
need $ src : deps
buildWithResources rs $ Target context (Ghc Compile stage) [src] [hiboot]
else need [ hiboot -<.> obootsuf way ]
path <//> "*" <.> hibootsuf way %> \hiboot -> need [ hiboot -<.> obootsuf way ]
-- TODO: add dependencies for #include of .h and .hs-incl files (gcc -MM?)
path <//> "*" <.> osuf way %> \obj -> do
......@@ -36,15 +24,11 @@ compilePackage rs context@Context {..} = do
need $ src : deps
build $ Target context (Cc Compile stage) [src] [obj]
else do
if compileInterfaceFilesSeparately && "//*.hs" ?== src
then need $ (obj -<.> hisuf way) : src : deps
else need $ src : deps
need $ src : deps
buildWithResources rs $ Target context (Ghc Compile stage) [src] [obj]
-- TODO: get rid of these special cases
path <//> "*" <.> obootsuf way %> \obj -> do
(src, deps) <- dependencies path obj
if compileInterfaceFilesSeparately
then need $ (obj -<.> hibootsuf way) : src : deps
else need $ src : deps
need $ src : deps
buildWithResources rs $ Target context (Ghc Compile stage) [src] [obj]
......@@ -18,16 +18,13 @@ 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 $$@)))
-- TODO: Simplify
ghcBuilderArgs :: Args
ghcBuilderArgs = (stagedBuilder (Ghc Compile) ||^ stagedBuilder (Ghc Link)) ? do
output <- getOutput
stage <- getStage
way <- getWay
when (stage > Stage0) . lift $ needTouchy
let buildObj = any (\s -> ("//*." ++ s way) ?== output) [ osuf, obootsuf]
buildHi = any (\s -> ("//*." ++ s way) ?== output) [hisuf, hibootsuf]
buildProg = not (buildObj || buildHi)
let buildObj = any (\s -> ("//*." ++ s way) ?== output) [ osuf, obootsuf]
mconcat [ commonGhcArgs
, arg "-H32m"
, stage0 ? arg "-O"
......@@ -35,11 +32,10 @@ ghcBuilderArgs = (stagedBuilder (Ghc Compile) ||^ stagedBuilder (Ghc Link)) ? do
, arg "-Wall"
, arg "-fwarn-tabs"
, splitObjectsArgs
, buildProg ? ghcLinkArgs
, not buildProg ? arg "-c"
, not buildObj ? ghcLinkArgs
, buildObj ? arg "-c"
, append =<< getInputs
, buildHi ? append ["-fno-code", "-fwrite-interface"]
, not buildHi ? mconcat [ arg "-o", arg =<< getOutput ] ]
, arg "-o", arg =<< getOutput ]
ghcLinkArgs :: Args
ghcLinkArgs = stagedBuilder (Ghc Link) ? do
......
module Settings.User (
buildRootPath, trackBuildSystem, compileInterfaceFilesSeparately,
userArgs, userPackages, userLibraryWays, userRtsWays, userKnownPackages,
integerLibrary, buildHaddock, validating, ghciWithDebugger, ghcProfiled,
ghcDebugged, dynamicGhcPrograms, laxDependencies, verboseCommands,
turnWarningsIntoErrors, splitObjects
buildRootPath, trackBuildSystem, userArgs, userPackages, userLibraryWays,
userRtsWays, userKnownPackages, integerLibrary, buildHaddock, validating,
ghciWithDebugger, ghcProfiled, ghcDebugged, dynamicGhcPrograms,
laxDependencies, verboseCommands, turnWarningsIntoErrors, splitObjects
) where
import Base
......@@ -94,7 +93,3 @@ verboseCommands = return False
-- | To enable -Werror in Stage2 set turnWarningsIntoErrors = stage2.
turnWarningsIntoErrors :: Predicate
turnWarningsIntoErrors = return False
-- | Decouple the compilation of @*.hi@ and @*.o@ files by setting to True.
compileInterfaceFilesSeparately :: Bool
compileInterfaceFilesSeparately = False
Supports Markdown
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