#! /bin/csh -f
# the above line doesn't really work on the Amiga, but it's nice to be formal

# this file can be a little screwy to fool csh into acting like it should

alias basename usr:bin/basename


setenv BIN usr:bin
set space " "


### extract current files from RCS WITHOUT locking (cat is there to succeed)
# echo
# echo "	Extracting RCS Files (ignore existing files)
# co -M -q RCS/*.h,v | cat


### create prototype header
echo
echo "	Creating Prototypes"
foreach i ( *.c ) "set j `basename $i .c` ; prototype $i >pro/$j.pro"
cat pro/*.pro > prototypes.h

set filelist filelist


# make list of .o files
echo -n > $filelist
foreach i ( RCS/*.c,v ) " set j ` basename $i .c,v ` ; echo -n $space $j.o >> $filelist "


### set list of .o files

# set list `cat filelist`
# setenv OFILES $list

# cheat
cp filelist env:OFILES
echo -n OFILES= >env:OMACRO
cat env:OFILES >>env:OMACRO

### make it all
smake -f sas.makefile BIN=$BIN $OMACRO all

### backups
# copy #?.h #?.c usr:src/cbackup
