#!/bin/sh
#
# links all object files to the tmp-directory

DEFDIR=/tmp

echo -n "Link to which directory: "
read tmp

echo "Creating .setenv (using Do)"
Do -s
. .setenv

for file in ${CALL}
do
	dir=`dirname ${file}`
	ofile=${dir}/`basename ${file} .c`.o

	[ ! -d ${tmp}/${dir} ] && {
		echo mkdir ${tmp}/${dir}
		mkdir ${tmp}/${dir} || {
			echo mkdir failed
			exit
		}
	}
	
	echo ln -s ${tmp}/${ofile} ${ofile}
	ln -s ${tmp}/${ofile} ${ofile}
done
