home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / gofer230.zip / Progs / Gofer / Scripts / goferc < prev    next >
Text File  |  1994-06-23  |  1KB  |  40 lines

  1. #!/bin/sh
  2. # This shell script invokes the Gofer compiler `gofc' to produce a C file,
  3. # followed by the `gcc' C compiler to produce an executable. Arguments are as
  4. # for `gofer' and `gofc'. Like `gofc', it uses the last argument to form the
  5. # program name, but ensures that this has an extension to avoid overwriting.
  6. #
  7. # Ian Holyer,  October 1993  (now uses sh, not csh)
  8.  
  9. args=$*
  10. while test $# -gt 1; do shift; done
  11. case $1 in
  12.    *.gs)      prog=`dirname $1`/`basename $1 .gs` ;;
  13.    *.gof)     prog=`dirname $1`/`basename $1 .gof` ;;
  14.    *.lgs)     prog=`dirname $1`/`basename $1 .lgs` ;;
  15.    *.gp)      prog=`dirname $1`/`basename $1 .gp` ;;
  16.    *.prj)     prog=`dirname $1`/`basename $1 .prj` ;;
  17.    *.prelude) prog=`dirname $1`/`basename $1 .prelude` ;;
  18.    *.hs)      prog=`dirname $1`/`basename $1 .hs` ;;
  19.    *.has)     prog=`dirname $1`/`basename $1 .has` ;;
  20.    *.lhs)     prog=`dirname $1`/`basename $1 .lhs` ;;
  21.    *.lit)     prog=`dirname $1`/`basename $1 .lit` ;;
  22.    *.verb)    prog=`dirname $1`/`basename $1 .verb` ;;
  23.    *)
  24.       echo The source program $1 does not have one of the standard
  25.       echo extensions for Gofer or Haskell program or project files:
  26.       echo '(.gs .gof .lgs .gp .prj .prelude .hs .has .lhs .lit or .verb)'
  27.       exit
  28.       ;;
  29. esac
  30.  
  31. GOFER=/home/staff/ian/gofer/lib/standard.prelude
  32. export GOFER
  33. /usr/local/lib/Gofer/gofc $args
  34. echo '[Compiling with gcc]'
  35. gcc -o $prog -O $prog.c /usr/local/lib/Gofer/runtime.o -lm
  36. strip $prog
  37. rm $prog.c
  38.  
  39.