#!/bin/sh
#
# gofcc:
#
# A simple shell script to compile C files produced by the Gofer compiler
#
#
# WARNING: This script takes an output C file produced by the Gofer compiler
# and compiles and links it with the runtime library to make a standalone
# executable for your system.  The first parameter to this shell is used as
# the name of the output executable file and the C code input is required to
# have the same name but with a .c extension.  Do not use this script to
# compile programs which do not have an extension or use a project file
# without an extension since the executable generated by this script will
# replace the source file with the same name.
#
# e.g. GOOD     % gofc myfile.gs ; gofcc myfile
#               % gofc + proj.gp ; gofcc proj
#
#      VERY BAD % gofc myfile ; gofcc myfile  (source `myfile' destroyed)
#               % gofc + proj ; gofcc proj    (project file `proj' destroyed)
#

cc -o $1 -O $1.c /usr/local/lib/Gofer/runtime.o -lm
strip $1
