20293N/A# make abstract machine executor with state
20293N/A# @(#)mamexec (gsf@research.att.com) 07/17/94
20293N/A# mamexec [ -dfins ] [ target ... ] < mam-file
20293N/A# NOTE: variables defined in this script may conflict with
20293N/A -*[abceghjklmopqrtuvwxyz_A-Z0-9]*) # [!...] not portable
20293N/A echo "Usage: $_command_ [ -dfins ] [ target ... ] < mam-file" >&2; exit 2
20293N/A *d*) _debug_="eval echo $_command_: debug: >&2" ;;
20293N/A(set -e; false || true) && _set_=e || echo $_command_: command errors ignored because of shell botch >&2
20293N/Aif test -f $_state_list_ -a -f $_state_time_
20293N/Athen mamstate $_state_list_ < $_state_list_ | sort > $_tmp_
20293N/A for _i_ in `comm -12 $_state_time_ $_tmp_ | sed 's/ .*//'`
20293N/A*) # read strips \ -- thanks a lot
20293N/A # tmp file avoids char at a time read
20293N/Awhile IFS=' '; $_read_ _op_ _arg_ _val_
20293N/A "make") eval _name_$_index_=$_name_
20293N/A eval _cmds_$_index_='"$_cmds_"'
20293N/A *" metarule "*) _attr_=m$_attr_ ;;
20293N/A _) echo $_op_: missing make op >&2; continue ;;
20293N/A "meta"|"suff") _attr_=m$_attr_ ;;
20293N/A *) $_exec_ "$_begin_$_set_$_cmds_$_end_" ||
20293N/A *) echo "*** exit code $_code_ making $_name_" >&2
20293N/A eval _attr_=$_prop_'$'_attr_$_index_
20293N/A *) echo $_val_: $_op_ $_name_ expected >&2
20293N/A"") echo "$_command_: don't know how to make $_select_" >&2; $_error_ ;;
20293N/A"eval") echo "$_list_" > $_state_list_
20293N/A mamstate $_state_list_ < $_state_list_ | sort > $_state_time_