git @ Cat's Eye Technologies PL-GOTO.NET / 6a9303b
Reform build system. Chris Pressey 5 years ago
3 changed file(s) with 27 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
22 *.hi
33 *.o
44 *.so
5 bin/PLexceptGOTOdotNET
0 #!/bin/sh
1
2 THIS=`realpath $0`
3 DIR=`dirname $THIS`
4 NAME=`basename $THIS`
5 SRC=$DIR/../src
6 if [ -x $DIR/$NAME.exe ] ; then
7 exec $DIR/$NAME.exe $*
8 elif command -v runhaskell 2>&1 >/dev/null ; then
9 exec runhaskell -i$SRC $SRC/Main.hs $*
10 elif command -v runhugs 2>&1 >/dev/null ; then
11 exec runhugs -i$SRC $SRC/Main.hs $*
12 else
13 echo "Cannot run $NAME; neither $NAME.exe, runhaskell, nor runhugs found."
14 exit 1
15 fi
11
22 PROG=PLexceptGOTOdotNET
33
4 if [ x`which ghc` = x -a x`which runhugs` = x ]; then
5 echo "Neither ghc nor runhugs found on search path."
6 exit 1
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) || exit 1
7 else
8 echo "ghc not found, not building $PROG.exe"
79 fi
810
9 mkdir -p bin
10
11 if [ x`which ghc` = x -o ! x$USE_HUGS = x ]; then
12 # create script to run with Hugs
13 cat >bin/$PROG <<'EOF'
14 #!/bin/sh
15 THIS=`realpath $0`
16 DIR=`dirname $THIS`/../src
17 runhugs $DIR/Main.hs $*
18 EOF
19 chmod 755 bin/$PROG
20 else
21 cd src && ghc --make Main.hs -o ../bin/$PROG
22 fi
11 #if command -v hastec >/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