author | wenzelm |
Fri, 12 Jun 1998 17:06:58 +0200 | |
changeset 5033 | 06f03dc5a1dc |
parent 4581 | 52edf5ac3afa |
child 5386 | 4325d853494a |
permissions | -rwxr-xr-x |
3255 | 1 |
#!/bin/bash |
2755 | 2 |
# |
3 |
# $Id$ |
|
4 |
# |
|
2902 | 5 |
# build - compile the Isabelle system and object-logics |
2755 | 6 |
|
7 |
||
4457 | 8 |
## global settings |
9 |
||
10 |
ALL_LOGICS="CCL CTT Cube FOL FOLP HOL HOLCF LCF Pure Sequents ZF" |
|
11 |
||
12 |
||
2789 | 13 |
## settings |
14 |
||
15 |
PRG=$(basename $0) |
|
2755 | 16 |
|
2789 | 17 |
ISABELLE_HOME=$(dirname $0) |
18 |
. $ISABELLE_HOME/lib/scripts/getsettings || \ |
|
2936
bd33e7aae062
fixed { ... } shell syntax to accomodate bash 2.x;
wenzelm
parents:
2918
diff
changeset
|
19 |
{ echo "$PRG probably not called from its original place!"; exit 2; } |
2755 | 20 |
|
2789 | 21 |
|
2879 | 22 |
## diagnostics |
23 |
||
24 |
function usage() |
|
25 |
{ |
|
26 |
echo |
|
27 |
echo "Usage: $PRG [OPTIONS] [LOGICS ...]" |
|
28 |
echo |
|
29 |
echo " Options are:" |
|
30 |
echo " -a all logics" |
|
2902 | 31 |
echo " -b batch mode" |
2918 | 32 |
echo " -t run tests" |
2879 | 33 |
echo |
3184 | 34 |
echo " Compile the named LOGICS (default $ISABELLE_LOGIC), or all object logics" |
2879 | 35 |
echo " in the distribution." |
36 |
echo |
|
37 |
exit 1 |
|
38 |
} |
|
39 |
||
40 |
function fail() |
|
41 |
{ |
|
42 |
echo "$1" >&2 |
|
43 |
exit 2 |
|
44 |
} |
|
45 |
||
46 |
||
47 |
## process command line |
|
48 |
||
49 |
# options |
|
50 |
||
51 |
ALL="" |
|
2902 | 52 |
BATCH="" |
2918 | 53 |
TEST="" |
2755 | 54 |
|
2918 | 55 |
while getopts "abt" OPT |
2879 | 56 |
do |
57 |
case "$OPT" in |
|
58 |
a) |
|
59 |
ALL=true |
|
60 |
;; |
|
2902 | 61 |
b) |
62 |
BATCH=true |
|
63 |
;; |
|
2918 | 64 |
t) |
65 |
TEST=test |
|
66 |
;; |
|
2879 | 67 |
\?) |
68 |
usage |
|
69 |
;; |
|
70 |
esac |
|
71 |
done |
|
72 |
||
73 |
shift $(($OPTIND - 1)) |
|
74 |
||
75 |
||
76 |
# args |
|
77 |
||
78 |
LOGICS="$@" |
|
79 |
||
4457 | 80 |
[ -n "$ALL" ] && LOGICS="$LOGICS $ALL_LOGICS" |
81 |
[ -z "$LOGICS" ] && LOGICS="$ISABELLE_LOGIC" |
|
82 |
||
2879 | 83 |
|
84 |
## main |
|
85 |
||
86 |
# tell the user about current values |
|
87 |
||
2902 | 88 |
if [ -z "$BATCH" ]; then |
89 |
echo |
|
90 |
echo " *****************************" |
|
91 |
echo " * Welcome to Isabelle build *" |
|
92 |
echo " *****************************" |
|
93 |
echo |
|
94 |
echo "Please check $ISABELLE_HOME/etc/settings" |
|
95 |
[ -f $ISABELLE_HOME_USER/etc/settings ] && echo "AND $ISABELLE_HOME_USER/etc/settings" |
|
96 |
echo "to make sure that Isabelle's ML system settings are appropriate." |
|
97 |
echo |
|
98 |
echo "Your current values are:" |
|
99 |
echo |
|
100 |
echo " ML_SYSTEM=$ML_SYSTEM" |
|
101 |
echo " ML_HOME=$ML_HOME" |
|
102 |
echo " ML_OPTIONS=$ML_OPTIONS" |
|
103 |
fi |
|
2789 | 104 |
|
105 |
||
2879 | 106 |
# check logics |
2755 | 107 |
|
2902 | 108 |
if [ -z "$BATCH" ]; then |
109 |
echo |
|
110 |
echo |
|
111 |
echo "Press RETURN to start compilation (including parents) of:" |
|
112 |
echo |
|
113 |
fi |
|
2879 | 114 |
|
4457 | 115 |
|
116 |
MAKE_LOGICS="" |
|
2879 | 117 |
|
4457 | 118 |
for L in $LOGICS |
119 |
do |
|
120 |
DIR=$ISABELLE_HOME/src/$L |
|
121 |
if [ -f $DIR/IsaMakefile ]; then |
|
122 |
MAKE_LOGICS="$MAKE_LOGICS $L" |
|
123 |
else |
|
124 |
echo "No such logic: $L" |
|
125 |
fi |
|
126 |
done |
|
127 |
||
2879 | 128 |
|
2902 | 129 |
if [ -z "$BATCH" ]; then |
4457 | 130 |
echo " " $MAKE_LOGICS |
2902 | 131 |
echo |
132 |
read |
|
133 |
else |
|
134 |
echo |
|
4457 | 135 |
echo "Isabelle build:" $MAKE_LOGICS |
2914 | 136 |
echo |
2902 | 137 |
echo "ML_SYSTEM=$ML_SYSTEM" |
138 |
echo "ML_HOME=$ML_HOME" |
|
139 |
echo "ML_OPTIONS=$ML_OPTIONS" |
|
140 |
echo |
|
141 |
fi |
|
2755 | 142 |
|
143 |
||
2879 | 144 |
# build it |
145 |
||
4457 | 146 |
SECONDS=0 |
2914 | 147 |
echo -n "Started at "; date |
148 |
||
2781 | 149 |
export THIS_IS_ISABELLE_BUILD=true |
2755 | 150 |
|
4457 | 151 |
for L in $MAKE_LOGICS |
2755 | 152 |
do |
4581 | 153 |
( cd $ISABELLE_HOME/src/$L; $ISATOOL make images $TEST ) |
2755 | 154 |
done |
2902 | 155 |
|
2914 | 156 |
echo -n "Finished at "; date |
4457 | 157 |
|
158 |
ELAPSED=$($ISABELLE_HOME/lib/scripts/showtime $SECONDS) |
|
159 |
echo "$ELAPSED total elapsed time" |