git @ Cat's Eye Technologies ZOWIE / 7594fd6
Add start of build infrastructure. Chris Pressey 11 months ago
5 changed file(s) with 65 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 *.exe
1 *.hi
2 *.o
3 *.js
4 *.jsmod
0 #!/bin/sh
1
2 THIS=`realpath $0`
3 DIR=`dirname $THIS`
4 NAME=`basename $THIS`
5 SRC=$DIR/../src
6 if [ "x$FORCE_HUGS" != "x" ] ; then
7 exec runhugs -i$SRC $SRC/Main.hs $*
8 elif [ -x $DIR/$NAME.exe ] ; then
9 exec $DIR/$NAME.exe $*
10 elif command -v runhaskell 2>&1 >/dev/null ; then
11 exec runhaskell -i$SRC $SRC/Main.hs $*
12 elif command -v runhugs 2>&1 >/dev/null ; then
13 exec runhugs -i$SRC $SRC/Main.hs $*
14 else
15 echo "Cannot run $NAME; neither $NAME.exe, nor runhaskell, nor runhugs found."
16 exit 1
17 fi
0 #!/bin/sh
1
2 PROG=zowie
3
4 if command -v ghc >/dev/null 2>&1; then
5 echo "building $PROG.exe with ghc"
6 (cd src && ghc --make Main.hs -o ../bin/$PROG.exe)
7 else
8 echo "ghc not found, not building $PROG.exe"
9 fi
10
11 if command -v hastec-not-yet >/dev/null 2>&1; then
12 echo "building $PROG.js with hastec"
13 (cd src && hastec --make HasteMain.hs -o ../demo/$PROG.js) || exit 1
14 else
15 echo "hastec not found, not building $PROG.js"
16 fi
101101 commitAndRepeat :: State -> State
102102 commitAndRepeat state@State{ saved=(Just previous) } =
103103 state{ pc=((pc previous) - 1) }
104
105
106 run s = s
0 module Main where
1
2 import System.Environment
3 import System.Exit
4 import System.IO
5
6 import Language.ZOWIE
7
8
9 main = do
10 args <- getArgs
11 case args of
12 ["run", fileName] -> do
13 text <- readFile fileName
14 putStrLn $ show $ reverse $ run text
15 return ()
16 _ -> do
17 abortWith "Usage: zowie run <carriage-program-text-filename>"
18
19 abortWith msg = do
20 hPutStrLn stderr msg
21 exitWith (ExitFailure 1)