#!/bin/sh -
# call this Unix script "MagicScript1"
# To use: MagicScript1 *.f 
#	  that translates *.f to *.c and polish the resulting C code from f2c. 
#
# Note: define trans_dir as the directory that contains this file.
#
trans_dir=/home/barad-dur/jwd/users/mercedes-tmp/LAPACK_v2.0/LAPACK_Final_Release2.0/NEW_CLAPACK/CLAPACK/Translate

for file do	
       base=`echo $file | sed -e 's/\.f//g'`
   # run_stripper
       ${trans_dir}/f2c -A < ${base}.f | ${trans_dir}/lenscrub > ${base}.c
   # run_comment
       	sed -f ${trans_dir}/delete.sed ${base}.c > ${base}.t
	mv -f ${base}.t ${base}.c
      	${trans_dir}/comment < ${base}.c > ${base}.t
       	mv -f ${base}.t ${base}.c
done

