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