author | berghofe |
Sun, 12 Oct 1997 22:04:06 +0200 | |
changeset 3844 | 7704dc8997ed |
parent 3747 | cd9b6c86926c |
child 3848 | 97bb3ff3c771 |
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 |
||
73 |
||
3636
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
74 |
# prepare directories for html and graph output |
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
75 |
|
3747
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
76 |
if [ $INFO = "true" -a ! -d $ISABELLE_BROWSER_INFO ]; then |
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
77 |
mkdir -p $ISABELLE_BROWSER_INFO/gif |
3844 | 78 |
cp $ISABELLE_HOME/lib/images/*arrow.gif $ISABELLE_BROWSER_INFO/gif |
79 |
cp $ISABELLE_HOME/lib/logo/isabelle_transparent.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
|
80 |
cp $ISABELLE_HOME/lib/html/index1.html $ISABELLE_BROWSER_INFO/index.html |
3636
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
81 |
mkdir -p $ISABELLE_BROWSER_INFO/graph |
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
82 |
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
|
83 |
mkdir $ISABELLE_BROWSER_INFO/graph/GraphBrowser |
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
84 |
mkdir $ISABELLE_BROWSER_INFO/graph/awtUtilities |
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
85 |
cp $ISABELLE_HOME/lib/browser/G*/*.class $ISABELLE_BROWSER_INFO/graph/G* |
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
86 |
cp $ISABELLE_HOME/lib/browser/a*/*.class $ISABELLE_BROWSER_INFO/graph/a* |
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
87 |
fi |
3f2e55e5bacc
Added some code for generating theory browsing data.
berghofe
parents:
3504
diff
changeset
|
88 |
|
2808 | 89 |
|
90 |
## main |
|
91 |
||
92 |
[ -z "$SESSION" ] && SESSION=$(basename $NAME) |
|
93 |
||
94 |
if [ -n "$BUILD" ]; then |
|
95 |
exec $ISABELLE \ |
|
3747
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
96 |
-e "make_html := $INFO; make_graph := $INFO; output_dir := \"$ISABELLE_BROWSER_INFO\"; home_path := \"$HOME\"; set_session\"$SESSION\"; exit_use_dir\".\"; make_html := false; make_graph := false;" \ |
3504 | 97 |
-q -w $LOGIC $NAME |
2808 | 98 |
else |
99 |
exec $ISABELLE \ |
|
3747
cd9b6c86926c
There is now one single option -i for generating theory browsing
berghofe
parents:
3636
diff
changeset
|
100 |
-e "make_html := $INFO; make_graph := $INFO; output_dir := \"$ISABELLE_BROWSER_INFO\"; home_path := \"$HOME\"; set_session\"$SESSION\"; exit_use_dir\"$NAME\"; make_html := false; make_graph := false; quit();" \ |
2808 | 101 |
-r -q $LOGIC |
102 |
fi |