drasil-build-0.1.1.0: A framework for code and document generation for scientific software - Build System SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Build.Drasil.Make.Helpers

Description

Helper functions for creating Makefiles.

Synopsis

Documentation

($=) :: MVar -> String -> Doc Source #

Assignment operator ("=").

win :: MVar -> String Source #

Extracts information for Windows OS from a variable.

mac :: MVar -> String Source #

Extracts information for Mac OS from a variable.

linux :: MVar -> String Source #

Extracts information for Linux OS from a variable.

defineOsVars :: (MVar -> String) -> [MVar] -> Doc Source #

Defines variables dependent on OS.

osDefinitions :: [MVar] -> Doc Source #

Helper for rendering OS-specific variables.

uniqueVars :: [MVar] -> [MVar] Source #

Deduplicates a list of variables and ensures duplicate variables have the same definition.

varName :: MVar -> String Source #

Extracts the variable name from a Makefile variable.

extractVars :: Rule -> [MVar] Source #

Extracts variables from a Makefile rule.

getVars :: MakeString -> [MVar] Source #

Gets one or more variables from a MakeString.

isOsVar :: MVar -> Bool Source #

Checks if a variable is OS dependent.

addCommonFeatures :: [Rule] -> Doc -> Doc Source #

Helper for prepending common features to a Makefile.

tab :: Doc Source #

Recipes must be indented with tabs.

msIndent :: Doc -> Doc Source #

Makefile Syntax Indent (i.e. non recipes).