#!/bin/sh
LISP=gcl
if [ $# = 2 ] ; then LISP=$2 ; fi

TMP=/tmp/tmpd$$
mkdir ${TMP}
cp $@ ${TMP}

for v in $@ ; 
do
echo '(load (format nil "~a~a" si::*system-directory* "../cmpnew/gcl_collectfn"))' \
   '(compiler::emit-fn t)'\
   "(compile-file \"${TMP}/$v\" :o-file nil)" | ${LISP}
done

mv ${TMP}/*.fn .
rm -f -r ${TMP}

