author | paulson |
Mon, 18 Oct 1999 15:18:24 +0200 | |
changeset 7878 | 43b03d412b82 |
parent 7782 | d4a6464ed61e |
child 7889 | 56e91ac0f074 |
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" |
6256 | 32 |
echo " -i make images" |
33 |
echo " -t make test" |
|
2879 | 34 |
echo |
3184 | 35 |
echo " Compile the named LOGICS (default $ISABELLE_LOGIC), or all object logics" |
2879 | 36 |
echo " in the distribution." |
37 |
echo |
|
38 |
exit 1 |
|
39 |
} |
|
40 |
||
41 |
function fail() |
|
42 |
{ |
|
43 |
echo "$1" >&2 |
|
44 |
exit 2 |
|
45 |
} |
|
46 |
||
47 |
||
48 |
## process command line |
|
49 |
||
50 |
# options |
|
51 |
||
52 |
ALL="" |
|
2902 | 53 |
BATCH="" |
6256 | 54 |
IMAGES="" |
2918 | 55 |
TEST="" |
2755 | 56 |
|
6256 | 57 |
while getopts "abit" OPT |
2879 | 58 |
do |
59 |
case "$OPT" in |
|
60 |
a) |
|
61 |
ALL=true |
|
62 |
;; |
|
2902 | 63 |
b) |
64 |
BATCH=true |
|
65 |
;; |
|
6256 | 66 |
i) |
67 |
IMAGES=images |
|
68 |
;; |
|
2918 | 69 |
t) |
70 |
TEST=test |
|
71 |
;; |
|
2879 | 72 |
\?) |
73 |
usage |
|
74 |
;; |
|
75 |
esac |
|
76 |
done |
|
77 |
||
78 |
shift $(($OPTIND - 1)) |
|
79 |
||
80 |
||
81 |
# args |
|
82 |
||
83 |
LOGICS="$@" |
|
84 |
||
4457 | 85 |
[ -n "$ALL" ] && LOGICS="$LOGICS $ALL_LOGICS" |
86 |
[ -z "$LOGICS" ] && LOGICS="$ISABELLE_LOGIC" |
|
87 |
||
2879 | 88 |
|
89 |
## main |
|
90 |
||
91 |
# tell the user about current values |
|
92 |
||
2902 | 93 |
if [ -z "$BATCH" ]; then |
94 |
echo |
|
95 |
echo " *****************************" |
|
96 |
echo " * Welcome to Isabelle build *" |
|
97 |
echo " *****************************" |
|
98 |
echo |
|
99 |
echo "Please check $ISABELLE_HOME/etc/settings" |
|
100 |
[ -f $ISABELLE_HOME_USER/etc/settings ] && echo "AND $ISABELLE_HOME_USER/etc/settings" |
|
5386 | 101 |
echo "to make sure that Isabelle's ML system settings and compilation options" |
102 |
echo "are appropriate." |
|
2902 | 103 |
echo |
5386 | 104 |
echo "The current values are:" |
2902 | 105 |
echo |
106 |
echo " ML_SYSTEM=$ML_SYSTEM" |
|
107 |
echo " ML_HOME=$ML_HOME" |
|
108 |
echo " ML_OPTIONS=$ML_OPTIONS" |
|
7277 | 109 |
echo " ML_PLATFORM=$ML_PLATFORM" |
5386 | 110 |
echo |
111 |
echo " ISABELLE_USEDIR_OPTIONS=$ISABELLE_USEDIR_OPTIONS" |
|
2902 | 112 |
fi |
2789 | 113 |
|
114 |
||
2879 | 115 |
# check logics |
2755 | 116 |
|
2902 | 117 |
if [ -z "$BATCH" ]; then |
118 |
echo |
|
119 |
echo |
|
120 |
echo "Press RETURN to start compilation (including parents) of:" |
|
121 |
echo |
|
122 |
fi |
|
2879 | 123 |
|
4457 | 124 |
|
125 |
MAKE_LOGICS="" |
|
2879 | 126 |
|
4457 | 127 |
for L in $LOGICS |
128 |
do |
|
129 |
DIR=$ISABELLE_HOME/src/$L |
|
130 |
if [ -f $DIR/IsaMakefile ]; then |
|
131 |
MAKE_LOGICS="$MAKE_LOGICS $L" |
|
132 |
else |
|
133 |
echo "No such logic: $L" |
|
134 |
fi |
|
135 |
done |
|
136 |
||
2879 | 137 |
|
2902 | 138 |
if [ -z "$BATCH" ]; then |
4457 | 139 |
echo " " $MAKE_LOGICS |
2902 | 140 |
echo |
141 |
read |
|
142 |
else |
|
143 |
echo |
|
4457 | 144 |
echo "Isabelle build:" $MAKE_LOGICS |
2914 | 145 |
echo |
2902 | 146 |
echo "ML_SYSTEM=$ML_SYSTEM" |
147 |
echo "ML_HOME=$ML_HOME" |
|
148 |
echo "ML_OPTIONS=$ML_OPTIONS" |
|
7311 | 149 |
echo "ML_PLATFORM=$ML_PLATFORM" |
2902 | 150 |
echo |
5393 | 151 |
echo "ISABELLE_USEDIR_OPTIONS=$ISABELLE_USEDIR_OPTIONS" |
152 |
echo |
|
2902 | 153 |
fi |
2755 | 154 |
|
155 |
||
2879 | 156 |
# build it |
157 |
||
4457 | 158 |
SECONDS=0 |
7277 | 159 |
DATE=$(date) |
160 |
HOST=$(hostname) |
|
161 |
echo "Started at $DATE ($HOST)" |
|
2914 | 162 |
|
7782 | 163 |
unset ISABELLE_SETTINGS_PRESENT |
2781 | 164 |
export THIS_IS_ISABELLE_BUILD=true |
2755 | 165 |
|
4457 | 166 |
for L in $MAKE_LOGICS |
2755 | 167 |
do |
6256 | 168 |
( cd $ISABELLE_HOME/src/$L; $ISATOOL make $IMAGES $TEST ) |
2755 | 169 |
done |
2902 | 170 |
|
2914 | 171 |
echo -n "Finished at "; date |
4457 | 172 |
|
173 |
ELAPSED=$($ISABELLE_HOME/lib/scripts/showtime $SECONDS) |
|
174 |
echo "$ELAPSED total elapsed time" |