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