Safe Haskell | None |
---|---|
Language | Haskell98 |
- data OS
- data Platform = Platform {}
- data ArmVersion
- data X86Version
- data Arch
- data Target = Target {
- targetOS :: OS
- targetPlatform :: Platform
- targetArch :: Arch
- class ToBuildPrefix a where
- data Linkage
- module Development.Shake.Language.C.BuildFlags
- executable :: Action ToolChain -> FilePath -> Action (BuildFlags -> BuildFlags) -> Action [FilePath] -> Rules FilePath
- staticLibrary :: Action ToolChain -> FilePath -> Action (BuildFlags -> BuildFlags) -> Action [FilePath] -> Rules FilePath
- sharedLibrary :: Action ToolChain -> FilePath -> Action (BuildFlags -> BuildFlags) -> Action [FilePath] -> Rules FilePath
- loadableLibrary :: Action ToolChain -> FilePath -> Action (BuildFlags -> BuildFlags) -> Action [FilePath] -> Rules FilePath
- data ToolChain
- data ToolChainVariant
- applyEnv :: ToolChain -> Action ToolChain
- toEnv :: ToolChain -> Action [(String, String)]
Build targets
This library's focus is on cross compilation. Here's a list of modules that provide support for targeting specific platforms:
Target operating system.
Target platform.
Basically just a platform identifier string. Use toBuildPrefix
to convert a platform to a file path prefix that can be used in Shake rules.
data ArmVersion Source #
Arm
architecture version.
data X86Version Source #
X86
architecture version.
Target architecture.
Use toBuildPrefix
to convert an architecture to a short, more or less canonical file path prefix that can be used in Shake rules.
X86 X86Version | Intel |
Arm ArmVersion | Arm architecture |
LLVM_IR | LLVM intermediate representation, used by |
Compilation target triple consisting of operating system, platform and architecture.
Use toBuildPrefix
to convert a target to a file path prefix that can be used in Shake rules. The prefix is of the form
<platform>/<architecture>
For example:
>>>
import qualified Development.Shake.Language.C.Target.OSX as OSX
>>>
toBuildPrefix $ OSX.target OSX.iPhoneOS (Arm Armv7)
"iphoneos/armv7"
Target | |
|
class ToBuildPrefix a where Source #
Convert a value to a build directory prefix.
The idea is that several such values can be combined to form more complex build directory hierarchies. This can be important for disambiguating build product paths in Shake rules.
toBuildPrefix :: a -> FilePath Source #
Convert a value to a (unique) build directory prefix.
High-level build rules
Linkage type, static or shared.
:: Action ToolChain | Action returning a target |
-> FilePath | Output file |
-> Action (BuildFlags -> BuildFlags) | Action returning a |
-> Action [FilePath] | Action returning a list of input source files |
-> Rules FilePath | Rule returning the output file path |
Shake rule for building an executable.
:: Action ToolChain | Action returning a target |
-> FilePath | Output file |
-> Action (BuildFlags -> BuildFlags) | Action returning a |
-> Action [FilePath] | Action returning a list of input source files |
-> Rules FilePath | Rule returning the output file path |
Shake rule for building a static library.
:: Action ToolChain | Action returning a target |
-> FilePath | Output file |
-> Action (BuildFlags -> BuildFlags) | Action returning a |
-> Action [FilePath] | Action returning a list of input source files |
-> Rules FilePath | Rule returning the output file path |
Shake rule for building a shared (dynamically linked) library.
:: Action ToolChain | Action returning a target |
-> FilePath | Output file |
-> Action (BuildFlags -> BuildFlags) | Action returning a |
-> Action [FilePath] | Action returning a list of input source files |
-> Rules FilePath | Rule returning the output file path |
Shake rule for building a dynamically loadable library.
Toolchain types and utilities
data ToolChainVariant Source #
Toolchain variant.
applyEnv :: ToolChain -> Action ToolChain Source #
Apply the current environment and return a modified toolchain.
This function is experimental and subject to change!
Currently recognised environment variables are
CC
- Path to
C
compiler. LD
- Path to linker.
SHAKE_TOOLCHAIN_VARIANT
- One of the values of
ToolChainVariant
(case insensitive). If this variable is not present, an attempt is made to determine the toolchain variant from theC
compiler command.