#!/bin/sh
# $Id: Regress,v 1.5 2008/08/04 23:01:53 tom Exp $
if [ ! -d OBJ ] ; then
	mkdir OBJ
fi
OPT=
while test $# != 0
do
	case $1 in
	-f)
		OPT="$OPT $1 $2"
		shift
		;;
	*=*)
		OPT="$OPT $1"
		;;
	-*)	OPT="$OPT $1"
		;;
	*)
		base=`basename $1`
		root=`basename $base .ppc`
		test "$root" = "$base" && root=`basename $base .pc`
		test "$root" = "$base" && root=`basename $base .c`
		NewObj=`basename $root .o`.o
		RefObj=OBJ/$NewObj
		case `pwd` in #(vi
		*/ncurses*/*)
			if test -d ../objects ; then
				NewObj=../objects/$NewObj
			elif test -d ../obj_s ; then
				NewObj=../obj_s/$NewObj
			fi
			;;
		esac
		if (remake $OPT $NewObj)
		then
			if [ -f $RefObj ] ; then
				size $NewObj $RefObj
				cmp $NewObj $RefObj
			else
				mv $NewObj $RefObj
			fi
		fi
		;;
	esac
	shift
done
