#!/bin/sh
# call from the source root as 'mklinks ../sun4 ../src'
find . -type d -print | sort | sed -e "s#^\.#mkdir $1#" | sh
root=`echo $2 | sed -e "s#^\.\./##"`
find . ! -type d -a ! -name Config -print | sed -e "s#^\./##" | while read file
	do
		down="`echo $file | sed -e 's#[^/]*/#../#g' -e 's#[^/]*$#..#'`"
		ln -s "$down/$root/$file" "$1/$file"
	done
