Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/cmd/mam/mamsh.sh
1808 views
1
########################################################################
2
# #
3
# This software is part of the ast package #
4
# Copyright (c) 1989-2011 AT&T Intellectual Property #
5
# and is licensed under the #
6
# Eclipse Public License, Version 1.0 #
7
# by AT&T Intellectual Property #
8
# #
9
# A copy of the License is available at #
10
# http://www.eclipse.org/org/documents/epl-v10.html #
11
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
12
# #
13
# Information and Software Systems Research #
14
# AT&T Research #
15
# Florham Park NJ #
16
# #
17
# Glenn Fowler <[email protected]> #
18
# #
19
########################################################################
20
: mam to sh script filter
21
22
COMMAND=mamsh
23
case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
24
0123) ARGV0="-a $COMMAND"
25
USAGE=$'
26
[-?
27
@(#)$Id: mamsh (AT&T Labs Research) 1994-01-01 $
28
]
29
'$USAGE_LICENSE$'
30
[+NAME?mamsh - make abstract machine to shell script conversion filter]
31
[+DESCRIPTION?\bmamsh\b converts \aMAM\a (Make Abstract Machine)
32
instructions on the standard input to a \bsh\b(1) script
33
that updates all targets on the standard output. The script
34
summarily builds each target; use \bmamake\b(1), \bnmake\b(1)
35
or \bgmake\b(1) for target out-of-date testing.]
36
[+SEE ALSO?\bmamake\b(1), \bnmake\b(1)]
37
'
38
;;
39
*) ARGV0=""
40
USAGE=""
41
;;
42
esac
43
44
usage()
45
{
46
OPTIND=0
47
getopts $ARGV0 "$USAGE" OPT '-?'
48
exit 2
49
}
50
51
while getopts $ARGV0 "$USAGE" OPT
52
do case $OPT in
53
*) usage ;;
54
esac
55
done
56
57
echo ": : generated from makefile abstraction : :"
58
echo 'eval ${1+"$@"}'
59
sed -n -e 's/^[0-9][0-9 ]*//' -e 's/^setv \([^ ]*\) \(.*\)/\1=${\1-\2}/p' -e 's/^exec [^ ]* //p' ${1+"$@"}
60
61