#!/bin/sh
#
# Setup program for donkey		by kazu@is.aist-nara.ac.jp
#

case $# in
0)
	UNAME=`which uname`
	if [ -x $UNAME ]; then
		ARCH=`$UNAME -a | awk '{print $1 "." $3}' | sed 's/\///'`
	else
		echo uname not found. specify architecture name.
		exit 1
	fi
	;;
1)
	ARCH=$1
	;;
esac
OBJD=obj

# some sh can't support -n for echo, sigh
echo "Set up ${OBJD}/${ARCH} ... "

if [ ! -d ${OBJD} ]; then
	rm -f ${OBJD}
	mkdir ${OBJD}
fi

cd ${OBJD}

if [ -d ${ARCH} -o -f ${ARCH} ]; then
	rm -rf ${ARCH}
fi

mkdir ${ARCH}
cd ${ARCH}

for i in `\ls ../../src`
do
	ln -s ../../src/$i $i
done
/bin/rm common.h
cp ../../src/common.h .


echo "Done"
echo "To make qvplay for ${ARCH}, type:"
echo "       cd ${OBJD}/${ARCH}"
echo "       ./configure"
echo "       (modify common.h to set-up default tty device for serial port)"
echo "       make"

#

