#!/bin/sh
#  make_from_exe.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.
#  
# make from executable if executable exists
# first argument is command to execute, second argument is object to make
OPD_E=${1%% *} # strip off parameters of executable
#echo $OPD_E
if [ -x $OPD_E ] ;then 
	if [ -n "$3" ] ; then echo $3 > $2 ;else rm -f $2 ;fi
	$1 >> $2 
	if [ -n "$4" ] ; then echo $4 >> $2 ;fi
	cp $2 old_$2 
else if [ -e old_$2 ] ;then cp old_$2 $2 
	else if [ -n "$3" ] ; then echo $3 > $2 ;else rm -f $2 ;fi
    	if [ -n "$3" ] ; then echo "Executable \`$OPD_E' not installed" >> $2 
		else echo "Executable \\verb|$OPD_E| not installed" >> $2 ;fi
		echo "and no old version of \`$2'" >> $2
    	echo "present. Delete \`$2' and" >> $2
		echo "recreate this manual after you have" >> $2
		echo "installed ObjectProDSP." >> $2
    	if [ -n "$4" ] ; then echo $4 >> $2 ;fi
	fi
fi

