Reform build system.
Chris Pressey
5 years ago
2 | 2 |
*.hi
|
3 | 3 |
*.o
|
4 | 4 |
*.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
|
1 | 1 |
|
2 | 2 |
PROG=PLexceptGOTOdotNET
|
3 | 3 |
|
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"
|
7 | 9 |
fi
|
8 | 10 |
|
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
|