| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Development.Shake.Language.C.ToolChain
Description
Synopsis
- data Linkage
- data ToolChain
- data ToolChainVariant
- toolDirectory :: forall cat. ArrowApply cat => Lens cat ToolChain (Maybe FilePath)
- toolPrefix :: forall cat. ArrowApply cat => Lens cat ToolChain String
- variant :: forall cat. ArrowApply cat => Lens cat ToolChain ToolChainVariant
- compilerCommand :: forall cat. ArrowApply cat => Lens cat ToolChain FilePath
- type Compiler = ToolChain -> BuildFlags -> FilePath -> FilePath -> Action ()
- compiler :: forall cat. ArrowApply cat => Lens cat ToolChain Compiler
- archiverCommand :: forall cat. ArrowApply cat => Lens cat ToolChain FilePath
- type Archiver = ToolChain -> BuildFlags -> [FilePath] -> FilePath -> Action ()
- archiver :: forall cat. ArrowApply cat => Lens cat ToolChain Archiver
- linkerCommand :: forall cat. ArrowApply cat => Lens cat ToolChain FilePath
- type Linker = ToolChain -> BuildFlags -> [FilePath] -> FilePath -> Action ()
- data LinkResult
- linker :: forall cat. ArrowApply cat => Lens cat ToolChain (LinkResult -> Linker)
- defaultBuildFlags :: forall cat. ArrowApply cat => Lens cat ToolChain (Action (BuildFlags -> BuildFlags))
- applyEnv :: ToolChain -> Action ToolChain
- toEnv :: ToolChain -> Action [(String, String)]
- defaultToolChain :: ToolChain
- defaultCompiler :: Compiler
- defaultArchiver :: Archiver
- defaultLinker :: Linker
- toolFromString :: ToolChain -> String -> FilePath
- tool :: ToolChain -> (ToolChain :-> String) -> FilePath
Documentation
Linkage type, static or shared.
Instances
| Enum Linkage # | |
| Eq Linkage # | |
| Show Linkage # | |
Working with toolchains
data ToolChainVariant #
Toolchain variant.
Constructors
| Generic | Unspecified toolchain |
| GCC | GNU Compiler Collection (gcc) toolchain |
| LLVM | Low-Level Virtual Machine (LLVM) toolchain |
Instances
| Eq ToolChainVariant # | |
Defined in Development.Shake.Language.C.ToolChain Methods (==) :: ToolChainVariant -> ToolChainVariant -> Bool # (/=) :: ToolChainVariant -> ToolChainVariant -> Bool # | |
| Show ToolChainVariant # | |
Defined in Development.Shake.Language.C.ToolChain Methods showsPrec :: Int -> ToolChainVariant -> ShowS # show :: ToolChainVariant -> String # showList :: [ToolChainVariant] -> ShowS # | |
toolDirectory :: forall cat. ArrowApply cat => Lens cat ToolChain (Maybe FilePath) #
Directory prefix for tools in a ToolChain, e.g. /usr/local/linux-armv5-eabi/bin.
toolPrefix :: forall cat. ArrowApply cat => Lens cat ToolChain String #
Prefix string for tools in a ToolChain, e.g. "linux-armv5-eabi-".
variant :: forall cat. ArrowApply cat => Lens cat ToolChain ToolChainVariant #
Toolchain variant.
compilerCommand :: forall cat. ArrowApply cat => Lens cat ToolChain FilePath #
Compiler command, usually used in the compiler action.
Arguments
| = ToolChain | Toolchain |
| -> BuildFlags | Compiler flags |
| -> FilePath | Input source file |
| -> FilePath | Output object file |
| -> Action () |
Action type for producing an object file from a source file.
Compiler action for this ToolChain.
archiverCommand :: forall cat. ArrowApply cat => Lens cat ToolChain FilePath #
Archiver command, usually used in the archiver action.
Arguments
| = ToolChain | Toolchain |
| -> BuildFlags | Archiver flags |
| -> [FilePath] | Input object files |
| -> FilePath | Output object archive (static library) |
| -> Action () |
Action type for archiving object files into a static library.
Archiver action for this ToolChain.
linkerCommand :: forall cat. ArrowApply cat => Lens cat ToolChain FilePath #
Linker command, usually used in the linker action.
Arguments
| = ToolChain | Toolchain |
| -> BuildFlags | Linker flags |
| -> [FilePath] | Input object files |
| -> FilePath | Output link product |
| -> Action () |
Action type for linking object files into an executable or a library.
data LinkResult #
Link result type
Constructors
| Executable | Executable |
| SharedLibrary | Shared (dynamically linked) library |
| LoadableLibrary | Dynamically loadable library |
Instances
| Enum LinkResult # | |
Defined in Development.Shake.Language.C.ToolChain Methods succ :: LinkResult -> LinkResult # pred :: LinkResult -> LinkResult # toEnum :: Int -> LinkResult # fromEnum :: LinkResult -> Int # enumFrom :: LinkResult -> [LinkResult] # enumFromThen :: LinkResult -> LinkResult -> [LinkResult] # enumFromTo :: LinkResult -> LinkResult -> [LinkResult] # enumFromThenTo :: LinkResult -> LinkResult -> LinkResult -> [LinkResult] # | |
| Eq LinkResult # | |
Defined in Development.Shake.Language.C.ToolChain | |
| Show LinkResult # | |
Defined in Development.Shake.Language.C.ToolChain Methods showsPrec :: Int -> LinkResult -> ShowS # show :: LinkResult -> String # showList :: [LinkResult] -> ShowS # | |
linker :: forall cat. ArrowApply cat => Lens cat ToolChain (LinkResult -> Linker) #
Linker action for this ToolChain.
defaultBuildFlags :: forall cat. ArrowApply cat => Lens cat ToolChain (Action (BuildFlags -> BuildFlags)) #
Action returning the default BuildFlags for this ToolChain.
Interfacing with other build systems
applyEnv :: ToolChain -> Action ToolChain #
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
Ccompiler. 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 theCcompiler command.
toEnv :: ToolChain -> Action [(String, String)] #
Export a ToolChain definition to a list of environment variable mappings, suitable e.g. for calling third-party configure scripts in cross-compilation mode.
Needs some fleshing out; currently only works for "standard" binutil toolchains.
Utilities for toolchain writers
defaultToolChain :: ToolChain #
Default toolchain.
Probably not useful without modification.
Default compiler action.
Default archiver action.
defaultLinker :: Linker #
Default linker action.
Given a tool chain command name, construct the command's full path, taking into account the toolchain's toolPrefix.