Commit d65ad0b0 authored by Andrew Gibiansky's avatar Andrew Gibiansky

Updated build setup to run build-parser.sh automatically

parent 0ac0c84a
......@@ -39,7 +39,7 @@ maintainer: andrew.gibiansky@gmail.com
category: Development
build-type: Simple
build-type: Custom
-- Constraint on the version of Cabal needed to build this package.
cabal-version: >=1.8
......@@ -76,6 +76,8 @@ executable IHaskell
-- .hs or .lhs file containing the Main module.
main-is: Main.hs
build-tools: happy, cpphs
-- Modules included in this executable, other than Main.
other-modules:
IHaskell.Eval.Completion
......
import Distribution.Simple
import System.Cmd
import Control.Monad
main :: IO ()
main = defaultMain
main = defaultMainWithHooks simpleUserHooks{
preConf = \args confFlags -> do
buildParser
preConf simpleUserHooks args confFlags
}
buildParser = system "./build-parser.sh"
#!/bin/sh
# Called from Setup.hs.
# Preprocess the GHC parser we're using to CPP subs.
cpphs --linepragma --text HaskellParser.y.pp -OParser.y
# Compile the parser and remove intermediate file.
happy Parser.y
rm Parser.y
# Move output Haskell to source directory.
mkdir -p IHaskell/GHC
mv Parser.hs IHaskell/GHC/HaskellParser.hs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment