Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides functions for easy C builds of binaries, static libraries, and dynamic libraries.
Synopsis
- data CConfig = CConfig {}
- data CCompiler
- staticLibR :: CCompiler -> [FilePath] -> FilePattern -> CConfig -> Rules ()
- sharedLibR :: CCompiler -> [FilePath] -> FilePattern -> CConfig -> Rules ()
- objectFileR :: CCompiler -> CConfig -> FilePath -> FilePattern -> Rules ()
- dynLibR :: CCompiler -> [FilePath] -> FilePattern -> CConfig -> Rules ()
- cBin :: CCompiler -> [FilePath] -> FilePattern -> CConfig -> Rules ()
- cToLib :: CCompiler -> [FilePath] -> FilePattern -> CConfig -> Rules ()
- preprocessA :: CmdResult r => CCompiler -> FilePath -> FilePath -> CConfig -> Action r
- preprocessR :: CCompiler -> FilePath -> FilePattern -> CConfig -> Rules ()
- idOracle :: (RuleResult q ~ a, q ~ a, ShakeValue q) => Rules (q -> Action a)
- pkgConfig :: String -> Action [String]
- binaryA :: CmdResult r => CCompiler -> [FilePath] -> FilePath -> CConfig -> Action r
- staticLibA :: CmdResult r => CCompiler -> [FilePath] -> FilePattern -> CConfig -> Action r
- sharedLibA :: CmdResult r => CCompiler -> [FilePath] -> FilePattern -> CConfig -> Action r
- stripA :: CmdResult r => FilePath -> CCompiler -> Action r
- getCDepends :: MonadIO m => [FilePath] -> FilePath -> m [FilePath]
- getAll :: MonadIO m => [FilePath] -> FilePath -> m [FilePath]
- cconfigToArgs :: CConfig -> [String]
- ccToString :: CCompiler -> String
- ccFromString :: String -> CCompiler
- host :: String
- isCross :: CCompiler -> Bool
Types
Instances
Eq CConfig Source # | |
Show CConfig Source # | |
Generic CConfig Source # | |
Binary CConfig Source # | |
NFData CConfig Source # | |
Defined in Development.Shake.C | |
Hashable CConfig Source # | |
Defined in Development.Shake.C | |
type Rep CConfig Source # | |
Defined in Development.Shake.C type Rep CConfig = D1 (MetaData "CConfig" "Development.Shake.C" "shake-c-0.4.3.0-JRd13O8JIgGKZTB6HshgRZ" False) (C1 (MetaCons "CConfig" PrefixI True) ((S1 (MetaSel (Just "includes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: S1 (MetaSel (Just "libraries") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String])) :*: (S1 (MetaSel (Just "libDirs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: (S1 (MetaSel (Just "extras") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: S1 (MetaSel (Just "staticLink") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))))) | |
type RuleResult CConfig Source # | |
Defined in Development.Shake.C |
A data type representing the C compiler to be used.
Instances
Rules
:: CCompiler | |
-> [FilePath] | Object files to be linked |
-> FilePattern | File pattern for static library outputs |
-> CConfig | |
-> Rules () |
:: CCompiler | |
-> [FilePath] | Object files to be linked |
-> FilePattern | File pattern for shared library outputs |
-> CConfig | |
-> Rules () |
:: CCompiler | |
-> CConfig | |
-> FilePath | C source file |
-> FilePattern | Object file output |
-> Rules () |
These rules build an object file from a C source file.
:: CCompiler | |
-> [FilePath] | C source files |
-> FilePattern | Shared object file to be generated. |
-> CConfig | |
-> Rules () |
These rules build a dynamic library (.so
on Linux).
:: CCompiler | |
-> [FilePath] | C source files |
-> FilePattern | Binary file output |
-> CConfig | |
-> Rules () |
Rules for generating a binary from C source files. Can have at most have
one main
function.
:: CCompiler | |
-> [FilePath] | C source files |
-> FilePattern | Static libary output |
-> CConfig | |
-> Rules () |
Rules for making a static library from C source files. Unlike staticLibR
,
this also creates rules for creating object files.
:: CmdResult r | |
=> CCompiler | |
-> FilePath | Source file |
-> FilePath | Preprocessed output |
-> CConfig | |
-> Action r |
Since: 0.4.3.0
:: CCompiler | |
-> FilePath | C source file |
-> FilePattern | Preprocessed file output |
-> CConfig | |
-> Rules () |
Rules for preprocessing a C source file.
Since: 0.4.3.0
Oracles
idOracle :: (RuleResult q ~ a, q ~ a, ShakeValue q) => Rules (q -> Action a) Source #
Actions
pkgConfig :: String -> Action [String] Source #
Given a package name or path to a .pc
file, output flags for C compiler.
:: CmdResult r | |
=> CCompiler | |
-> [FilePath] | Source files |
-> FilePath | Executable output |
-> CConfig | |
-> Action r |
This action builds an executable.
Reëxports from Language.C.Dependency
Get any filepaths that were #include
-ed in a C source file.
:: MonadIO m | |
=> [FilePath] | Directories for included header/source files |
-> FilePath | File name |
-> m [FilePath] |
Get transitive dependencies of a C source file.
Helper functions
cconfigToArgs :: CConfig -> [String] Source #
Generate compiler flags for a given configuration.