# $Header: /data/cvsroot/mail/elmme+/ConfTool/Substitute,v 1.1 1998/11/10 16:30:08 hurtta Exp $
    . ./config.sh
    echo " "
    echo "Doing variable substitutions on .SH files..."
    set x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
    shift
    case $# in
    0) set x *.SH; shift;;
    esac
    if test ! -f $1; then
	shift
    fi
    for file in $*; do
	case "$file" in
	*/*)
	    dir=`$expr X$file : 'X\(.*\)/'`
	    file=`$expr X$file : 'X.*/\(.*\)'`
	    (cd $dir && . $file)
	    ;;
    	*)
	    . $file
	    ;;
    	esac
    done
    if test -f config.h.SH; then
    	if test ! -f config.h; then
	    : oops, they left it out of MANIFEST, probably, so do it anyway.
	    . config.h.SH
    	fi
    fi

    if $contains '^depend:' Makefile >/dev/null 2>&1; then
    	dflt=n
    	$cat <<EOM

Now you need to generate make dependencies by running "make depend".
You might prefer to run it in background: "make depend > makedepend.out &"
It can take a while, so you might not want to run it right now.

EOM
    	rp="Run make depend now? [$dflt]"
    	$echo $n "$rp $c"
    	. UU/myread
    	case "$ans" in
    	y*) make depend && echo "Now you must run a make."
	    ;;
    	*)  echo "You must run 'make depend' then 'make'."
	    ;;
    	esac
    elif test -f Makefile; then
    	echo " "
    	echo "Now you must run a make."
    else
    	echo "Done."
    fi
