-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSetup.lhs
More file actions
23 lines (18 loc) · 722 Bytes
/
Setup.lhs
File metadata and controls
23 lines (18 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env runhaskell
> import Distribution.Simple
> import Distribution.Simple.PreProcess
> import Distribution.Simple.Program
> import Distribution.Simple.LocalBuildInfo
> pp :: LocalBuildInfo -> Program -> [String] -> PreProcessor
> pp lbi prog args =
> PreProcessor {
> platformIndependent = True ,
> runPreProcessor = mkSimplePreProcessor $ \inf outf verb ->
> rawSystemProgramConf verb prog (withPrograms lbi)
> (args ++ ["-o", outf, inf])
> }
> ppAlex' :: [String] -> a -> LocalBuildInfo -> PreProcessor
> ppAlex' args _ lbi = pp lbi alexProgram args
> main = defaultMainWithHooks simpleUserHooks {
> hookedPreProcessors = [("x", ppAlex' ["-g", "-t", "alex"])]
> }