Commit 44ce5719 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add Base.hs with Shake imports and build paths.

parent f1249dab
module Base (
shakeFilesPath, configPath,
module Development.Shake,
module Development.Shake.Util,
module Development.Shake.Config,
module Development.Shake.Classes,
module Development.Shake.FilePath
) where
import Development.Shake
import Development.Shake.Util
import Development.Shake.Config
import Development.Shake.Classes
import Development.Shake.FilePath
shakeFilesPath :: FilePath
shakeFilesPath = "_build/"
configPath :: FilePath
configPath = "shake/cfg/"
......@@ -4,6 +4,7 @@ module Builder (
Builder (..), builderKey, builderPath, specified
) where
import Base
import Util
import Stage
import Data.List
......
......@@ -15,13 +15,13 @@ module Expression (
) where
import Way
import Base
import Stage
import Builder
import Package
import Target (Target)
import Target hiding (Target(..))
import qualified Target
import Oracles.Base
import Data.List
import Data.Monoid
import Control.Monad.Reader hiding (liftIO)
......
import Base
import Rules
import Development.Shake
main = shakeArgs shakeOptions{shakeFiles="_build/"} $ do
main = shakeArgs shakeOptions{shakeFiles = shakeFilesPath} $ do
oracleRules -- see module Rules.Oracles
packageRules -- see module Rules
configRules -- see module Rules.Config
......
......@@ -4,11 +4,10 @@ module Oracles.ArgsHash (
askArgsHash, argsHashOracle
) where
import Base
import Expression
import Settings.Args
import Control.Applicative
import Development.Shake
import Development.Shake.Classes
newtype ArgsHashKey = ArgsHashKey FullTarget
deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
......
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
module Oracles.Base (
module Development.Shake,
module Development.Shake.Util,
module Development.Shake.Config,
module Development.Shake.Classes,
askConfigWithDefault, askConfig, configOracle,
configPath,
putOracle
) where
import Base
import Util
import Control.Applicative
import Control.Monad.Extra
import Development.Shake
import Development.Shake.Util
import Development.Shake.Config
import Development.Shake.Classes
import qualified Data.HashMap.Strict as Map
configPath :: FilePath
configPath = "shake" -/- "cfg"
newtype ConfigKey = ConfigKey String
deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
......
......@@ -5,6 +5,7 @@ module Oracles.DependencyList (
dependencyListOracle
) where
import Base
import Util
import Oracles.Base
import Data.List
......
......@@ -4,6 +4,7 @@ module Oracles.Flag (
platformSupportsSharedLibs, ghcWithSMP, ghcWithNativeCodeGen
) where
import Base
import Util
import Oracles.Base
import Oracles.Setting
......
......@@ -5,6 +5,7 @@ module Oracles.PackageData (
pkgData, pkgDataList, packageDataOracle
) where
import Base
import Util
import Oracles.Base
import Data.List
......
......@@ -6,6 +6,7 @@ module Oracles.Setting (
ghcEnableTablesNextToCode
) where
import Base
import Stage
import Oracles.Base
......
......@@ -4,6 +4,7 @@ module Oracles.WindowsRoot (
windowsRoot, windowsRootOracle
) where
import Base
import Util
import Oracles.Base
import Data.List
......
......@@ -2,10 +2,10 @@
module Package (Package (..), library, topLevel, setCabal) where
import Base
import Util
import Data.Function
import GHC.Generics
import Development.Shake.Classes
-- pkgPath is the path to the source code relative to the root
data Package = Package
......
......@@ -4,6 +4,7 @@ module Rules (
module Rules.Package,
) where
import Base
import Util
import Stage
import Expression
......@@ -12,7 +13,6 @@ import Rules.Package
import Rules.Oracles
import Settings.Packages
import Settings.TargetDirectory
import Development.Shake
-- generateTargets needs package-data.mk files of all target packages
-- TODO: make interpretDiff total
......
......@@ -2,6 +2,7 @@ module Rules.Actions (
build, buildWithResources, run, verboseRun
) where
import Base
import Util
import Builder
import Expression
......@@ -9,7 +10,6 @@ import qualified Target
import Settings.Args
import Settings.Util
import Oracles.ArgsHash
import Development.Shake
-- Build a given target using an appropriate builder and acquiring necessary
-- resources. Force a rebuilt if the argument list has changed since the last
......
module Rules.Config (
configRules
) where
module Rules.Config (configRules) where
import Base
import Util
import Oracles.Base
configRules :: Rules ()
configRules = do
......
module Rules.Data (buildPackageData) where
import Base
import Util
import Package
import Builder
......@@ -10,7 +11,6 @@ import Settings.TargetDirectory
import Rules.Actions
import Control.Applicative
import Control.Monad.Extra
import Development.Shake
-- TODO: Add ordering between packages? (see ghc.mk)
-- Build package-data.mk by using GhcCabal to process pkgCabal file
......
module Rules.Dependencies (buildPackageDependencies) where
import Base
import Util
import Builder
import Package
......@@ -9,7 +10,6 @@ import Oracles.PackageData
import Settings.Util
import Settings.TargetDirectory
import Rules.Actions
import Development.Shake
buildPackageDependencies :: StagePackageTarget -> Rules ()
buildPackageDependencies target =
......
......@@ -2,6 +2,7 @@ module Rules.Oracles (
oracleRules
) where
import Base
import Oracles.Base
import Oracles.ArgsHash
import Oracles.PackageData
......
......@@ -2,10 +2,10 @@ module Rules.Package (
buildPackage
) where
import Base
import Expression
import Rules.Data
import Rules.Dependencies
import Development.Shake
buildPackage :: StagePackageTarget -> Rules ()
buildPackage = buildPackageData <> buildPackageDependencies
......@@ -3,13 +3,13 @@ module Settings.GhcCabal (
) where
import Way
import Base
import Util
import Stage
import Builder
import Package
import Switches
import Expression
import Oracles.Base
import Oracles.Flag
import Oracles.Setting
import Settings.User
......
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