#
#  This shell script compiles and libraries a C source file
#
echo ""
if ($#argv != 1) then				# if wrong number of arguments 
    echo error: supply one argument
    goto done
endif
if ((-e $argv[1]:r.c) == 0) then		# if file does not exist
    echo error: file $argv[1]:r.c does not exist
    goto done
endif
echo Compiling $argv[1]:r.c ...
cc -c -O $argv[1]:r.c				# compile it
if ($status != 0) goto done			# if the compilation failed
echo Replacing $argv[1]:r.o in tecoc.a ...
ar r tecoc.a $argv[1]:r.o
rm $argv[1]:r.o
ranlib tecoc.a
done:
