module Build.Drasil.Make.AST where
import Build.Drasil.Make.MakeString (MakeString)
import CodeLang.Drasil (Comment)
newtype Makefile = M [Rule]
data Rule = R Annotation Target Dependencies Type [Command]
data Command = C MakeString [CommandOpts]
data CommandOpts =
IgnoreReturnCode deriving CommandOpts -> CommandOpts -> Bool
(CommandOpts -> CommandOpts -> Bool)
-> (CommandOpts -> CommandOpts -> Bool) -> Eq CommandOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CommandOpts -> CommandOpts -> Bool
== :: CommandOpts -> CommandOpts -> Bool
$c/= :: CommandOpts -> CommandOpts -> Bool
/= :: CommandOpts -> CommandOpts -> Bool
Eq
data Type = Abstract
| File deriving Type -> Type -> Bool
(Type -> Type -> Bool) -> (Type -> Type -> Bool) -> Eq Type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Type -> Type -> Bool
== :: Type -> Type -> Bool
$c/= :: Type -> Type -> Bool
/= :: Type -> Type -> Bool
Eq
type Annotation = [Comment]
type Target = MakeString
type Dependencies = [Target]
mkFile :: Annotation -> Target -> Dependencies -> [Command] -> Rule
mkFile :: Annotation -> Target -> Dependencies -> [Command] -> Rule
mkFile Annotation
c Target
t Dependencies
d = Annotation -> Target -> Dependencies -> Type -> [Command] -> Rule
R Annotation
c Target
t Dependencies
d Type
File
mkRule :: Annotation -> Target -> Dependencies -> [Command] -> Rule
mkRule :: Annotation -> Target -> Dependencies -> [Command] -> Rule
mkRule Annotation
c Target
t Dependencies
d = Annotation -> Target -> Dependencies -> Type -> [Command] -> Rule
R Annotation
c Target
t Dependencies
d Type
Abstract
mkCheckedCommand :: MakeString -> Command
mkCheckedCommand :: Target -> Command
mkCheckedCommand = (Target -> [CommandOpts] -> Command)
-> [CommandOpts] -> Target -> Command
forall a b c. (a -> b -> c) -> b -> a -> c
flip Target -> [CommandOpts] -> Command
C []
mkCommand :: MakeString -> Command
mkCommand :: Target -> Command
mkCommand = (Target -> [CommandOpts] -> Command)
-> [CommandOpts] -> Target -> Command
forall a b c. (a -> b -> c) -> b -> a -> c
flip Target -> [CommandOpts] -> Command
C [CommandOpts
IgnoreReturnCode]