#!/bin/sh
#  check_index.sh from ObjectProDSP 0.2
#  Copyright (C) 1994 1995, Mountain Math Software, All rights reserved.
#  Licensed for free use and distribution under version 2 of the Gnu General
#  Public License. Please see file COPYING for details and restrictions.
#  
#  ObjectProDSP is a trademark of Mountain Math Software.
#  
OPD_DEST=$1
if [ ! -e $OPD_DEST.idx ] ;then touch $OPD_DEST.idx ;fi
if [ ! -e old_$OPD_DEST.idx ] ;then touch old_$OPD_DEST.idx ;fi
if ! cmp -s $OPD_DEST.idx old_$OPD_DEST.idx || [ ! -e $OPD_DEST.txx ] ;then 
	cp $OPD_DEST.idx old_$OPD_DEST.idx 
	if [ -e $OPD_DEST.txx ] ;then mv $OPD_DEST.txx old_$OPD_DEST.txx  ;fi
	echo Making index for $OPD_DEST 
	$OPD_ROOT/bin/indextex $OPD_DEST 
else cp $OPD_DEST.txx old_$OPD_DEST.txx
fi
make $OPD_DEST.dvi

