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
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CommandOpts -> CommandOpts -> Bool
$c/= :: CommandOpts -> CommandOpts -> Bool
== :: CommandOpts -> CommandOpts -> Bool
$c== :: CommandOpts -> CommandOpts -> Bool
Eq
data Type = Abstract
| File deriving Type -> Type -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Type -> Type -> Bool
$c/= :: Type -> Type -> Bool
== :: Type -> Type -> Bool
$c== :: 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 = forall a b c. (a -> b -> c) -> b -> a -> c
flip Target -> [CommandOpts] -> Command
C []
mkCommand :: MakeString -> Command
mkCommand :: Target -> Command
mkCommand = forall a b c. (a -> b -> c) -> b -> a -> c
flip Target -> [CommandOpts] -> Command
C [CommandOpts
IgnoreReturnCode]