ddc-build-0.4.1.3: Disciplined Disciple Compiler build framework.

Safe HaskellNone

DDC.Build.Builder

Synopsis

Documentation

data BuilderConfig Source

Configuration information for a builder that is not platform specific.

Constructors

BuilderConfig 

Fields

builderConfigBaseSrcDir :: FilePath

Directory that holds the source for the runtime system and base library.

builderConfigBaseLibDir :: FilePath

Directory that holds the shared objects for the runtime system and base library.

data Builder Source

Actions to use to invoke external compilation tools.

Constructors

Builder 

Fields

builderName :: String

The name of this platform.

buildHost :: Platform

The platform the build is being performed on.

buildTarget :: Platform

The platform we're compiling code for.

buildSpec :: Platform

The LLVM target specification. Gives the widths of pointers and primitive numeric types.

buildBaseSrcDir :: FilePath

Directory that holds the source for the runtime system and base library.

buildBaseLibDir :: FilePath

Directory that holds the shared objects for the runtime system and base library.

buildCC :: FilePath -> FilePath -> IO ()

Invoke the C compiler to compile a .c file into a .o file.

buildLlc :: FilePath -> FilePath -> IO ()

Invoke the LLVM compiler to compile a .ll file into a .s file.

buildAs :: FilePath -> FilePath -> IO ()

Invoke the system assembler to assemble a .s file into a .o file.

buildLdExe :: FilePath -> FilePath -> IO ()

Link an executable.

buildLdLibStatic :: [FilePath] -> FilePath -> IO ()

Link a static library.

buildLdLibShared :: [FilePath] -> FilePath -> IO ()

Link a shared library.

Instances

data BuilderResult Source

The result of a build command.

We use these so that the called doesn't need to worry about interpreting numeric exit codes.

Constructors

BuilderSuccess

Build command completed successfully.

BuilderCanceled

Build command was cancelled or killed by the user. eg by Control-C on the console.

BuilderFailed

Build command failed. There is probably something wrong with the generated file. Unrecognised exit codes also result in this BuilderResult.

Instances

builders :: BuilderConfig -> [Builder]Source

All supported builders. The host and target platforms are the same.

Supported builders are: x86_32-darwin, x86_64-darwin, x86_32-linux, x86_64-linux, x86_32-cygwin, ppc32-linux

determineDefaultBuilder :: BuilderConfig -> IO (Maybe Builder)Source

Determine the default builder based on the arch and uname commands. This assumes that the host and target platforms are the same.

If we don't recognise the result of arch or uname, or don't have a default builder config for this platform then Nothing.