Distribution.Simple.BuildPaths

Cabal-3.2.1.0: A framework for packaging Haskell software

Copyright | Isaac Jones 2003-2004 Duncan Coutts 2008
License | BSD3
Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Simple.BuildPaths

Contents

- Source files & build directories

Description

A bunch of dirs, paths and file names used for intermediate build steps.

Synopsis

- defaultDistPref :: FilePath
- srcPref :: FilePath -> FilePath
- haddockDirName :: HaddockTarget -> PackageDescription -> FilePath
- hscolourPref :: HaddockTarget -> FilePath -> PackageDescription -> FilePath
- haddockPref :: HaddockTarget -> FilePath -> PackageDescription -> FilePath
- autogenPackageModulesDir :: LocalBuildInfo -> String
- autogenComponentModulesDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> String
- autogenPathsModuleName :: PackageDescription -> ModuleName
- cppHeaderName :: String
- haddockName :: PackageDescription -> FilePath
- mkGenericStaticLibName :: String -> String
- mkLibName :: UnitId -> String
- mkProfLibName :: UnitId -> String
- mkGenericSharedLibName :: Platform -> CompilerId -> String -> String
- mkSharedLibName :: Platform -> CompilerId -> UnitId -> String
- mkStaticLibName :: Platform -> CompilerId -> UnitId -> String
- mkGenericSharedBundledLibName :: Platform -> CompilerId -> String -> String
- exeExtension :: Platform -> String
- objExtension :: String
- dllExtension :: Platform -> String
- staticLibExtension :: Platform -> String
- getSourceFiles :: Verbosity -> [FilePath] -> [ModuleName] -> IO [(ModuleName, FilePath)]
- getLibSourceFiles :: Verbosity -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO [(ModuleName, FilePath)]
- getExeSourceFiles :: Verbosity -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO [(ModuleName, FilePath)]
- getFLibSourceFiles :: Verbosity -> LocalBuildInfo -> ForeignLib -> ComponentLocalBuildInfo -> IO [(ModuleName, FilePath)]
- exeBuildDir :: LocalBuildInfo -> Executable -> FilePath
- flibBuildDir :: LocalBuildInfo -> ForeignLib -> FilePath

# Documentation

defaultDistPref :: FilePath Source #

srcPref :: FilePath -> FilePath Source #

haddockDirName :: HaddockTarget -> PackageDescription -> FilePath Source #

This is the name of the directory in which the generated haddocks should be stored. It does not include the `distdochtml` prefix.

hscolourPref :: HaddockTarget -> FilePath -> PackageDescription -> FilePath Source #

haddockPref :: HaddockTarget -> FilePath -> PackageDescription -> FilePath Source #

The directory to which generated haddock documentation should be written.

autogenPackageModulesDir :: LocalBuildInfo -> String Source #

The directory in which we put auto-generated modules for EVERY component in the package.

autogenComponentModulesDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> String Source #

The directory in which we put auto-generated modules for a particular component.

autogenPathsModuleName :: PackageDescription -> ModuleName Source #

The name of the auto-generated Paths_* module associated with a package

cppHeaderName :: String Source #

haddockName :: PackageDescription -> FilePath Source #

mkGenericStaticLibName :: String -> String Source #

Create a library name for a static library from a given name. Prepends `lib` and appends the static library extension (`.a`).

mkLibName :: UnitId -> String Source #

mkProfLibName :: UnitId -> String Source #

mkGenericSharedLibName :: Platform -> CompilerId -> String -> String Source #

Create a library name for a shared library from a given name. Prepends `lib` and appends the `-<compilerFlavour><compilerVersion>` as well as the shared library extension.

mkSharedLibName :: Platform -> CompilerId -> UnitId -> String Source #

mkStaticLibName :: Platform -> CompilerId -> UnitId -> String Source #

mkGenericSharedBundledLibName :: Platform -> CompilerId -> String -> String Source #

Create a library name for a bundled shared library from a given name. This matches the naming convention for shared libraries as implemented in GHC's packageHsLibs function in the Packages module. If the given name is prefixed with HS, then this prepends `lib` and appends the compiler flavour/version and shared library extension e.g.: "HSrts-1.0" -> "libHSrts-1.0-ghc8.7.20190109.so" Otherwise the given name should be prefixed with `C`, then this strips the `C`, prepends `lib` and appends the shared library extension e.g.: Cffi -> "libffi.so"

exeExtension :: Platform -> String Source #

Default extension for executable files on the current platform. (typically `""` on Unix and `"exe"` on Windows or OS/2)

objExtension :: String Source #

Extension for object files. For GHC the extension is `"o"`.

dllExtension :: Platform -> String Source #

Extension for dynamically linked (or shared) libraries (typically `"so"` on Unix and `"dll"` on Windows)

staticLibExtension :: Platform -> String Source #

Extension for static libraries

TODO: Here, as well as in dllExtension, it's really the target OS that we're interested in, not the build OS.

# Source files & build directories

getSourceFiles :: Verbosity -> [FilePath] -> [ModuleName] -> IO [(ModuleName, FilePath)] Source #

getLibSourceFiles :: Verbosity -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO [(ModuleName, FilePath)] Source #

getExeSourceFiles :: Verbosity -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO [(ModuleName, FilePath)] Source #

getFLibSourceFiles :: Verbosity -> LocalBuildInfo -> ForeignLib -> ComponentLocalBuildInfo -> IO [(ModuleName, FilePath)] Source #

exeBuildDir :: LocalBuildInfo -> Executable -> FilePath Source #

The directory where we put build results for an executable

flibBuildDir :: LocalBuildInfo -> ForeignLib -> FilePath Source #

The directory where we put build results for a foreign library