mach

A work-in-progress implementation of make(1)

git clone https://git.8pit.net/mach.git

 1module Mach.Error where
 2
 3import Control.Exception
 4import qualified Text.ParserCombinators.Parsec as P
 5
 6data TargetError
 7  = ZeroTargetsDefined
 8  | MultipleDefines
 9  | UnexpectedPrereqs
10  | NoTargetOrFile FilePath
11  | NoSuchTarget String
12
13instance Show TargetError where
14  show ZeroTargetsDefined = "no targets defined"
15  show MultipleDefines = "only one rule for a target can contain commands"
16  show UnexpectedPrereqs = "unexpected prerequisites"
17  show (NoSuchTarget tgt) = "no target named " ++ tgt ++ " was defined"
18  show (NoTargetOrFile n) = "no target or file named " ++ n
19
20data MakeErr
21  = ParserErr P.ParseError
22  | TargetErr TargetError
23  | ExecErr String
24  deriving (Show)
25
26instance Exception MakeErr