1 {-# LANGUAGE DuplicateRecordFields #-}
2 {-# LANGUAGE OverloadedStrings #-}
3 {-# LANGUAGE RecursiveDo #-}
4 {-# LANGUAGE StaticPointers #-}
6 module SetupHooks
where
8 import Distribution
.Simple
.LocalBuildInfo
(interpretSymbolicPathLBI
)
9 import Distribution
.Simple
.SetupHooks
10 import Distribution
.Utils
.Path
(makeRelativePathEx
)
12 import qualified Data
.List
.NonEmpty
as NE
( NonEmpty
(..) )
14 setupHooks
:: SetupHooks
19 { preBuildComponentRules
= Just
$ rules
(static
()) cyclicPreBuildRules
23 cyclicPreBuildRules
:: PreBuildComponentInputs
-> RulesM
()
24 cyclicPreBuildRules
(PreBuildComponentInputs
{ localBuildInfo
= lbi
, targetInfo
= tgt
}) = mdo
25 let clbi
= targetCLBI tgt
26 autogenDir
= autogenComponentModulesDir lbi clbi
27 action
= mkCommand
(static Dict
) (static
(\ () -> error "This should not run")) ()
28 r1
<- registerRule
"r1" $
30 [ RuleDependency
$ RuleOutput r2
0 ]
31 ( Location autogenDir
(makeRelativePathEx
"G1.hs") NE
.:|
[] )
32 r2
<- registerRule
"r2" $
34 [ RuleDependency
$ RuleOutput r1
0 ]
35 ( Location autogenDir
(makeRelativePathEx
"G2.hs") NE
.:|
[] )
36 r3
<- registerRule
"r3" $
38 [ RuleDependency
$ RuleOutput r3
0 ]
39 ( Location autogenDir
(makeRelativePathEx
"G3.hs") NE
.:|
[] )