home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
gofer230.zip
/
Progs
/
Gofer
/
Scripts
/
goferc
< prev
next >
Wrap
Text File
|
1994-06-23
|
1KB
|
40 lines
#!/bin/sh
#
# This shell script invokes the Gofer compiler `gofc' to produce a C file,
# followed by the `gcc' C compiler to produce an executable. Arguments are as
# for `gofer' and `gofc'. Like `gofc', it uses the last argument to form the
# program name, but ensures that this has an extension to avoid overwriting.
#
# Ian Holyer, October 1993 (now uses sh, not csh)
args=$*
while test $# -gt 1; do shift; done
case $1 in
*.gs) prog=`dirname $1`/`basename $1 .gs` ;;
*.gof) prog=`dirname $1`/`basename $1 .gof` ;;
*.lgs) prog=`dirname $1`/`basename $1 .lgs` ;;
*.gp) prog=`dirname $1`/`basename $1 .gp` ;;
*.prj) prog=`dirname $1`/`basename $1 .prj` ;;
*.prelude) prog=`dirname $1`/`basename $1 .prelude` ;;
*.hs) prog=`dirname $1`/`basename $1 .hs` ;;
*.has) prog=`dirname $1`/`basename $1 .has` ;;
*.lhs) prog=`dirname $1`/`basename $1 .lhs` ;;
*.lit) prog=`dirname $1`/`basename $1 .lit` ;;
*.verb) prog=`dirname $1`/`basename $1 .verb` ;;
*)
echo The source program $1 does not have one of the standard
echo extensions for Gofer or Haskell program or project files:
echo '(.gs .gof .lgs .gp .prj .prelude .hs .has .lhs .lit or .verb)'
exit
;;
esac
GOFER=/home/staff/ian/gofer/lib/standard.prelude
export GOFER
/usr/local/lib/Gofer/gofc $args
echo '[Compiling with gcc]'
gcc -o $prog -O $prog.c /usr/local/lib/Gofer/runtime.o -lm
strip $prog
rm $prog.c