author | paulson |
Fri, 13 Nov 1998 13:29:04 +0100 | |
changeset 5856 | 5fb5a626f3b9 |
parent 5393 | 7299e531d481 |
child 6256 | e17fb80b3ce1 |
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" |
|
5386 | 96 |
echo "to make sure that Isabelle's ML system settings and compilation options" |
97 |
echo "are appropriate." |
|
2902 | 98 |
echo |
5386 | 99 |
echo "The current values are:" |
2902 | 100 |
echo |
101 |
echo " ML_SYSTEM=$ML_SYSTEM" |
|
102 |
echo " ML_HOME=$ML_HOME" |
|
103 |
echo " ML_OPTIONS=$ML_OPTIONS" |
|
5386 | 104 |
echo |
105 |
echo " ISABELLE_USEDIR_OPTIONS=$ISABELLE_USEDIR_OPTIONS" |
|
2902 | 106 |
fi |
2789 | 107 |
|
108 |
||
2879 | 109 |
# check logics |
2755 | 110 |
|
2902 | 111 |
if [ -z "$BATCH" ]; then |
112 |
echo |
|
113 |
echo |
|
114 |
echo "Press RETURN to start compilation (including parents) of:" |
|
115 |
echo |
|
116 |
fi |
|
2879 | 117 |
|
4457 | 118 |
|
119 |
MAKE_LOGICS="" |
|
2879 | 120 |
|
4457 | 121 |
for L in $LOGICS |
122 |
do |
|
123 |
DIR=$ISABELLE_HOME/src/$L |
|
124 |
if [ -f $DIR/IsaMakefile ]; then |
|
125 |
MAKE_LOGICS="$MAKE_LOGICS $L" |
|
126 |
else |
|
127 |
echo "No such logic: $L" |
|
128 |
fi |
|
129 |
done |
|
130 |
||
2879 | 131 |
|
2902 | 132 |
if [ -z "$BATCH" ]; then |
4457 | 133 |
echo " " $MAKE_LOGICS |
2902 | 134 |
echo |
135 |
read |
|
136 |
else |
|
137 |
echo |
|
4457 | 138 |
echo "Isabelle build:" $MAKE_LOGICS |
2914 | 139 |
echo |
2902 | 140 |
echo "ML_SYSTEM=$ML_SYSTEM" |
141 |
echo "ML_HOME=$ML_HOME" |
|
142 |
echo "ML_OPTIONS=$ML_OPTIONS" |
|
143 |
echo |
|
5393 | 144 |
echo "ISABELLE_USEDIR_OPTIONS=$ISABELLE_USEDIR_OPTIONS" |
145 |
echo |
|
2902 | 146 |
fi |
2755 | 147 |
|
148 |
||
2879 | 149 |
# build it |
150 |
||
4457 | 151 |
SECONDS=0 |
2914 | 152 |
echo -n "Started at "; date |
153 |
||
2781 | 154 |
export THIS_IS_ISABELLE_BUILD=true |
2755 | 155 |
|
4457 | 156 |
for L in $MAKE_LOGICS |
2755 | 157 |
do |
4581 | 158 |
( cd $ISABELLE_HOME/src/$L; $ISATOOL make images $TEST ) |
2755 | 159 |
done |
2902 | 160 |
|
2914 | 161 |
echo -n "Finished at "; date |
4457 | 162 |
|
163 |
ELAPSED=$($ISABELLE_HOME/lib/scripts/showtime $SECONDS) |
|
164 |
echo "$ELAPSED total elapsed time" |