author | wenzelm |
Fri, 30 Jan 1998 11:01:49 +0100 | |
changeset 4586 | 6d0c1b2dc717 |
parent 4492 | ab441d89a2cb |
child 5034 | 8e43dab90429 |
permissions | -rwxr-xr-x |
3007 | 1 |
#!/bin/bash |
2808 | 2 |
# |
3 |
# $Id$ |
|
4 |
# |
|
5 |
# DESCRIPTION: build object-logic or run examples |
|
6 |
||
7 |
||
8 |
## diagnostics |
|
9 |
||
10 |
PRG=$(basename $0) |
|
11 |
||
12 |
function usage() |
|
13 |
{ |
|
14 |
echo |
|
15 |
echo "Usage: $PRG LOGIC NAME" |
|
16 |
echo |
|
17 |
echo " Options are:" |
|
18 |
echo " -b build mode (output heap image, use dir \".\")" |
|
3747
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
19 |
echo " -i BOOL generate theory browsing information," |
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
20 |
echo " i.e. HTML / graph data (default false)" |
2808 | 21 |
echo " -s NAME override session NAME" |
22 |
echo |
|
23 |
echo " Build object-logic or run examples. Also creates browsing" |
|
24 |
echo " information (HTML etc.) according to settings." |
|
25 |
echo |
|
26 |
exit 1 |
|
27 |
} |
|
28 |
||
29 |
||
30 |
## process command line |
|
31 |
||
32 |
# options |
|
33 |
||
34 |
BUILD="" |
|
3747
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
35 |
INFO=false |
2808 | 36 |
SESSION="" |
37 |
||
2917 | 38 |
function getoptions() |
39 |
{ |
|
40 |
OPTIND=1 |
|
3747
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
41 |
while getopts "bi:s:" OPT |
2917 | 42 |
do |
43 |
case "$OPT" in |
|
44 |
b) |
|
45 |
BUILD=true |
|
46 |
;; |
|
3747
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
47 |
i) |
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
48 |
INFO="$OPTARG" |
2917 | 49 |
;; |
50 |
s) |
|
51 |
SESSION="$OPTARG" |
|
52 |
;; |
|
53 |
\?) |
|
54 |
usage |
|
55 |
;; |
|
56 |
esac |
|
57 |
done |
|
58 |
} |
|
2808 | 59 |
|
2917 | 60 |
getoptions $ISABELLE_USEDIR_OPTIONS |
61 |
||
62 |
getoptions "$@" |
|
2808 | 63 |
shift $(($OPTIND - 1)) |
64 |
||
65 |
||
66 |
# args |
|
67 |
||
68 |
[ $# -ne 2 ] && usage |
|
69 |
||
70 |
LOGIC="$1"; shift |
|
71 |
NAME="$1"; shift |
|
72 |
||
4419 | 73 |
[ -z "$SESSION" ] && SESSION=$(basename $NAME) |
2808 | 74 |
|
4419 | 75 |
|
76 |
||
77 |
## main |
|
3636
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
78 |
|
4451 | 79 |
# prepare browser info dir |
4419 | 80 |
|
4586 | 81 |
if [ "$INFO" = "true" -a ! -f $ISABELLE_BROWSER_INFO/index.html ]; then |
4419 | 82 |
|
3747
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
83 |
mkdir -p $ISABELLE_BROWSER_INFO/gif |
4419 | 84 |
cp $ISABELLE_HOME/lib/images/blue_arrow.gif $ISABELLE_BROWSER_INFO/gif |
85 |
cp $ISABELLE_HOME/lib/images/red_arrow.gif $ISABELLE_BROWSER_INFO/gif |
|
3848 | 86 |
cp $ISABELLE_HOME/lib/logo/isabelle.gif $ISABELLE_BROWSER_INFO/gif/isabelle.gif |
3747
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
87 |
cp $ISABELLE_HOME/lib/html/index1.html $ISABELLE_BROWSER_INFO/index.html |
4419 | 88 |
|
3636
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
89 |
mkdir -p $ISABELLE_BROWSER_INFO/graph |
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
90 |
cp $ISABELLE_HOME/lib/html/index2.html $ISABELLE_BROWSER_INFO/graph/index.html |
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
91 |
mkdir $ISABELLE_BROWSER_INFO/graph/GraphBrowser |
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
92 |
mkdir $ISABELLE_BROWSER_INFO/graph/awtUtilities |
4419 | 93 |
cp $ISABELLE_HOME/lib/browser/GraphBrowser/*.class $ISABELLE_BROWSER_INFO/graph/GraphBrowser |
94 |
cp $ISABELLE_HOME/lib/browser/awtUtilities/*.class $ISABELLE_BROWSER_INFO/graph/awtUtilities |
|
95 |
||
3636
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
96 |
fi |
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
97 |
|
2808 | 98 |
|
4451 | 99 |
# prepare log dir |
100 |
||
101 |
LOGDIR="$ISABELLE_OUTPUT/log" |
|
102 |
mkdir -p "$LOGDIR" |
|
103 |
||
104 |
||
105 |
# run isabelle |
|
106 |
||
107 |
SECONDS=0 |
|
108 |
||
2808 | 109 |
if [ -n "$BUILD" ]; then |
4451 | 110 |
ITEM="$SESSION" |
111 |
echo -n "Building $ITEM ... " |
|
112 |
LOG="$LOGDIR/$ITEM" |
|
113 |
||
114 |
$ISABELLE \ |
|
4075 | 115 |
-e "make_html := $INFO; make_graph := $INFO; output_dir := \"$ISABELLE_BROWSER_INFO\"; home_path := \"$HOME\"; add_session\"$SESSION\"; exit_use_dir\".\"; make_html := false; make_graph := false;" \ |
4492 | 116 |
-q -w $LOGIC $NAME > $LOG 2>&1 |
2808 | 117 |
else |
4451 | 118 |
ITEM=$(basename $LOGIC)-"$SESSION" |
119 |
echo -n "Running $ITEM ... " |
|
120 |
LOG="$LOGDIR/$ITEM" |
|
121 |
||
122 |
$ISABELLE \ |
|
4075 | 123 |
-e "make_html := $INFO; make_graph := $INFO; output_dir := \"$ISABELLE_BROWSER_INFO\"; home_path := \"$HOME\"; add_session\"$SESSION\"; exit_use_dir\"$NAME\"; make_html := false; make_graph := false; quit();" \ |
4492 | 124 |
-r -q $LOGIC > $LOG 2>&1 |
2808 | 125 |
fi |
4451 | 126 |
|
127 |
RC=$? |
|
128 |
||
129 |
ELAPSED=$($ISABELLE_HOME/lib/scripts/showtime $SECONDS) |
|
130 |
||
131 |
||
132 |
# exit status |
|
133 |
||
134 |
if [ $RC -eq 0 ]; then |
|
135 |
echo "OK ($ELAPSED elapsed time)" |
|
136 |
gzip --force "$LOG" |
|
137 |
else |
|
138 |
echo "FAILED" |
|
139 |
echo "(see also $LOG)" |
|
140 |
echo; tail $LOG; echo |
|
141 |
fi |
|
142 |
||
143 |
exit $RC |