mamexec.sh revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1989-2011 AT&T Intellectual Property #
# and is licensed under the #
# Eclipse Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# Glenn Fowler <gsf@research.att.com> #
# #
########################################################################
#
# NOTE: variables defined in this script may conflict with mamfile variables
#
USAGE=$'
[-?
@(#)$Id: mamexec (AT&T Labs Research) 1994-04-17 $
]
[+NAME?mamexec - make abstract machine executor]
[+DESCRIPTION?\bmamexec\b reads MAM (Make Abstract Machine) target and
prerequisite file descriptions from the standard input and executes
actions to update targets that are older than their prerequisites.
Mamfiles are generated by the \b--mam\b option of \bnmake\b(1) and
\bgmake\b(1) and are portable to environments that only have
\bsh\b(1) and \bcc\b(1).]
[+?A separate \bmamstate\b(1) program is used to compare current and state
file target times. \bmamexec\b is a \bksh\b(1) script implementation
that has been replaced by the standalone \bmamake\b(1). New
applications should use \bmamake\b.]
[d:debug?Set the debug trace level to \alevel\a. Higher levels produce
more output.]
[f:force?Force all targets to be out of date.]
[i:ignore?Ignore shell action errors.]
[n!:exec?Enable shell action execution.]
[s:silent?Do not trace shell actions as they are executed.]
[ target ... ]
[+SEE ALSO?\bmamake\b(1), \bmamstate\b(1), \bnmake\b(1)]
'
;;
*) ARGV0=""
USAGE="dfins"
;;
esac
usage()
{
OPTIND=0
exit 2
}
_debug_=:
_diff_=.
_error_='exit 1'
_exec_=eval
_same_=.
trap 'rm -f $_tmp_' 0
trap 'exit 2' 1 2
f) _force_=1 ;;
i) _error_=: ;;
n) _exec_=echo ;;
s) _silent_=1 ;;
*) usage ;;
esac
done
while :
do case $# in
0) break ;;
esac
case $1 in
*=*) eval $1
;;
esac
;;
esac
shift
done
esac
(set -e; false || true) && _set_=e || echo $_command_: command errors ignored because of shell botch >&2
;;
"echo") _exec_=: ;;
esac
;;
esac
esac
;;
*) _set_=
;;
esac
if test -f $_state_list_ -a -f $_state_time_
esac
done
fi
_index_=_
;;
*) # read strips \ -- thanks a lot
# tmp file avoids char at a time read
_read_=read
exec < $_tmp_
;;
esac
_old_=1
"note") continue
;;
"mam") _old_= ;;
esac
continue
;;
__*:*|*:)
"eval") ;;
esac
;;
esac
"CC:") (
set -
code=1
fi
fi
cd /tmp
exit $code
;;
esac
continue
;;
esac
eval " case \"$_name_\" in
case \"$_select_\" in
\"*\") _select_=$_name_ ;;
esac
_match_=1
_attr_=x$_attr_
;;
esac"
"") eval " case \"$_name_\" in
$_same_);;
*) _attr_=u$_attr_ ;;
esac"
;;
;;
esac
esac
;;
esac
continue
;;
"") eval " case \"$_arg_\" in
$_same_) ;;
*) _attr_=u$_attr_ ;;
esac"
;;
;;
esac
continue
;;
esac
esac
esac
;;
"exec"|"....")
;;
esac
;;
esac
;;
;;
esac
;;
*m*) ;;
*x*u*|*u*x*)
*u*) _prop_=u ;;
esac
;;
{
_code_=$?
*-*e*) ;;
esac
;;
esac
0) ;;
;;
esac
}
_prop_=u
;;
esac
;;
esac
;;
;;
esac
;;
esac
done
esac
;;
esac