Commit 2f742548 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Refactor imports in Settings/Builders

parent 9d13cd84
module Rules.Libffi (rtsBuildPath, libffiRules, libffiDependencies) where
import Base
import Builder
import Expression
import GHC
import Oracles.Config.Flag
import Oracles.Config.Setting
import Oracles.WindowsPath
import Rules.Actions
import Settings.Builders.Common
import Settings.Packages.Rts
import Settings.Paths
import Target
import UserSettings
-- TODO: this should be moved elsewhere
rtsBuildPath :: FilePath
......
module Settings.Builders.Alex (alexBuilderArgs) where
import Predicate
import Settings.Builders.Common
alexBuilderArgs :: Args
alexBuilderArgs = builder Alex ? mconcat [ arg "-g"
......
module Settings.Builders.Ar (arBuilderArgs, arCmd, chunksOfSize) where
import Base
import Oracles.Config.Flag
import Oracles.Config.Setting
import Predicate
import Settings.Builders.Common
arBuilderArgs :: Args
arBuilderArgs = builder Ar ? mconcat [ arg "q"
......
module Settings.Builders.Cc (ccBuilderArgs) where
import Base
import Oracles.Config.Setting
import Oracles.PackageData
import Predicate
import Settings.Builders.Common
import Settings
ccBuilderArgs :: Args
ccBuilderArgs = builder Cc ? mconcat
......
module Settings.Builders.Common (
module Base,
module Expression,
module GHC,
module Oracles.Config.Flag,
module Oracles.Config.Setting,
module Oracles.PackageData,
module Oracles.WindowsPath,
module Predicate,
module Settings,
module Settings.Paths,
module UserSettings,
cIncludeArgs, ldArgs, cArgs, cWarnings, argSetting, argSettingList,
argStagedBuilderPath, argStagedSettingList
argStagedBuilderPath, argStagedSettingList, bootPackageDatabaseArgs
) where
import Base
import Expression
import GHC
import Oracles.Config.Flag
import Oracles.Config.Setting
import Oracles.PackageData
import Oracles.WindowsPath
import Predicate
import Settings
import Settings.Paths
import UserSettings
......@@ -56,3 +70,12 @@ argStagedSettingList ss = argSettingList . ss =<< getStage
argStagedBuilderPath :: (Stage -> Builder) -> Args
argStagedBuilderPath sb = argM . builderPath . sb =<< getStage
bootPackageDatabaseArgs :: Args
bootPackageDatabaseArgs = do
stage <- getStage
lift $ need [packageDbStamp stage]
stage0 ? do
path <- getTopDirectory
prefix <- ifM (builder Ghc) (return "-package-db ") (return "--package-db=")
arg $ prefix ++ path -/- packageDbDirectory Stage0
......@@ -2,11 +2,7 @@ module Settings.Builders.Configure (configureBuilderArgs) where
import qualified System.Info as System
import Base
import Oracles.Config.Setting
import Oracles.WindowsPath
import Predicate
import Settings.Paths
import Settings.Builders.Common
configureBuilderArgs :: Args
configureBuilderArgs = mconcat
......
module Settings.Builders.DeriveConstants (deriveConstantsBuilderArgs) where
import Base
import Oracles.Config.Flag
import Oracles.Config.Setting
import Predicate
import Settings.Builders.Common
import Settings.Paths
-- TODO: do we need to support `includes_CC_OPTS += -DDYNAMIC_BY_DEFAULT`?
deriveConstantsBuilderArgs :: Args
......
module Settings.Builders.GenApply (genApplyBuilderArgs) where
import Predicate
import Settings.Builders.Common
-- TODO: Dead code? ifeq "$(GhcUnregisterised)" "YES" GENAPPLY_OPTS = -u
genApplyBuilderArgs :: Args
......
module Settings.Builders.GenPrimopCode (genPrimopCodeBuilderArgs) where
import Predicate
import Settings.Builders.Common
genPrimopCodeBuilderArgs :: Args
genPrimopCodeBuilderArgs = builder GenPrimopCode ? mconcat
......
module Settings.Builders.Ghc (ghcBuilderArgs, ghcMBuilderArgs, commonGhcArgs) where
import Base
import Flavour
import GHC
import Oracles.Config.Flag
import Oracles.Config.Setting
import Oracles.PackageData
import Predicate
import Settings
import Settings.Builders.Common
import Settings.Builders.GhcCabal
import Settings.Paths
-- TODO: Add support for -dyno.
-- $1/$2/build/%.$$($3_o-bootsuf) : $1/$4/%.hs-boot
......
module Settings.Builders.GhcCabal (
ghcCabalBuilderArgs, ghcCabalHsColourBuilderArgs, bootPackageDatabaseArgs, buildDll0
ghcCabalBuilderArgs, ghcCabalHsColourBuilderArgs, buildDll0
) where
import Base
import Context
import Flavour
import GHC
import Oracles.Config.Flag
import Oracles.Config.Setting
import Oracles.WindowsPath
import Predicate
import Settings
import Settings.Builders.Common
import Settings.Paths
ghcCabalBuilderArgs :: Args
ghcCabalBuilderArgs = builder GhcCabal ? do
......@@ -84,15 +76,6 @@ configureArgs = do
, crossCompiling ? (conf "--host" $ argSetting TargetPlatformFull)
, conf "--with-cc" $ argStagedBuilderPath (Cc CompileC) ]
bootPackageDatabaseArgs :: Args
bootPackageDatabaseArgs = do
stage <- getStage
lift $ need [packageDbStamp stage]
stage0 ? do
path <- getTopDirectory
prefix <- ifM (builder Ghc) (return "-package-db ") (return "--package-db=")
arg $ prefix ++ path -/- packageDbDirectory Stage0
packageConstraints :: Args
packageConstraints = stage0 ? do
constraints <- lift . readFileLines $ bootPackageConstraints
......
module Settings.Builders.GhcPkg (ghcPkgBuilderArgs) where
import Base
import Predicate
import Settings
import Settings.Builders.GhcCabal
import Settings.Paths
import Settings.Builders.Common
ghcPkgBuilderArgs :: Args
ghcPkgBuilderArgs = builder GhcPkg ? (initArgs <> updateArgs)
......
module Settings.Builders.Haddock (haddockBuilderArgs) where
import Base
import GHC
import Oracles.PackageData
import Predicate
import Settings
import Settings.Builders.Common
import Settings.Builders.Ghc
import Settings.Paths
-- | Given a version string such as "2.16.2" produce an integer equivalent.
versionToInt :: String -> Int
......
module Settings.Builders.Happy (happyBuilderArgs) where
import Predicate
import Settings.Builders.Common
happyBuilderArgs :: Args
happyBuilderArgs = builder Happy ? mconcat [ arg "-agc"
......
module Settings.Builders.HsCpp (hsCppBuilderArgs) where
import GHC
import Oracles.Config.Setting
import Predicate
import Settings.Builders.Common
import Settings.Paths
hsCppBuilderArgs :: Args
hsCppBuilderArgs = builder HsCpp ? do
......
module Settings.Builders.Hsc2Hs (hsc2hsBuilderArgs) where
import Base
import Oracles.Config.Flag
import Oracles.Config.Setting
import Oracles.PackageData
import Oracles.WindowsPath
import Predicate
import Settings
import Settings.Builders.Common
templateHsc :: FilePath
......
module Settings.Builders.Ld (ldBuilderArgs) where
import Oracles.Config.Setting
import Predicate
import Settings.Builders.Common
ldBuilderArgs :: Args
......
module Settings.Builders.Make (makeBuilderArgs) where
import Base
import Predicate
import Settings.Paths
import Settings.Builders.Common
makeBuilderArgs :: Args
makeBuilderArgs = do
......
module Settings.Builders.Tar (tarBuilderArgs) where
import Predicate
import Settings.Builders.Common
tarBuilderArgs :: Args
tarBuilderArgs = builder Tar ? mconcat [ arg "-xf"
......
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