Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides functions for easy C builds of binaries, static libraries, and dynamic libraries.
- data CConfig = CConfig {}
- data CCompiler where
- 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 ()
- 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
- queryCC :: Action ()
- queryCfg :: Action ()
- examineCC :: CCompiler -> Rules ()
- examineCfg :: CConfig -> Rules ()
- 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
A data type representing the C compiler to be used.
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.
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.
Oracle helpers
examineCfg :: CConfig -> Rules () Source #
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.