author | skalberg |
Sat, 17 Apr 2004 23:55:58 +0200 | |
changeset 14621 | bd78bdbc85a9 |
parent 14056 | f8ed8428b41c |
child 14981 | e73f8140af78 |
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="" |
2755 | 59 |
|
14041 | 60 |
while getopts "abim:p:t" OPT |
2879 | 61 |
do |
62 |
case "$OPT" in |
|
63 |
a) |
|
64 |
ALL=true |
|
65 |
;; |
|
2902 | 66 |
b) |
67 |
BATCH=true |
|
68 |
;; |
|
6256 | 69 |
i) |
7889 | 70 |
TARGETS="$TARGETS images" |
71 |
;; |
|
72 |
m) |
|
73 |
TARGETS="$TARGETS $OPTARG" |
|
6256 | 74 |
;; |
2918 | 75 |
t) |
7889 | 76 |
TARGETS="$TARGETS test" |
2918 | 77 |
;; |
2879 | 78 |
\?) |
79 |
usage |
|
80 |
;; |
|
81 |
esac |
|
82 |
done |
|
83 |
||
84 |
shift $(($OPTIND - 1)) |
|
85 |
||
86 |
||
87 |
# args |
|
88 |
||
89 |
LOGICS="$@" |
|
90 |
||
4457 | 91 |
[ -n "$ALL" ] && LOGICS="$LOGICS $ALL_LOGICS" |
92 |
[ -z "$LOGICS" ] && LOGICS="$ISABELLE_LOGIC" |
|
93 |
||
2879 | 94 |
|
95 |
## main |
|
96 |
||
97 |
# tell the user about current values |
|
98 |
||
2902 | 99 |
if [ -z "$BATCH" ]; then |
100 |
echo |
|
101 |
echo " *****************************" |
|
102 |
echo " * Welcome to Isabelle build *" |
|
103 |
echo " *****************************" |
|
104 |
echo |
|
105 |
echo "Please check $ISABELLE_HOME/etc/settings" |
|
9789 | 106 |
[ -f "$ISABELLE_HOME_USER/etc/settings" ] && echo "AND $ISABELLE_HOME_USER/etc/settings" |
5386 | 107 |
echo "to make sure that Isabelle's ML system settings and compilation options" |
108 |
echo "are appropriate." |
|
2902 | 109 |
echo |
5386 | 110 |
echo "The current values are:" |
2902 | 111 |
echo |
112 |
echo " ML_SYSTEM=$ML_SYSTEM" |
|
113 |
echo " ML_HOME=$ML_HOME" |
|
114 |
echo " ML_OPTIONS=$ML_OPTIONS" |
|
7277 | 115 |
echo " ML_PLATFORM=$ML_PLATFORM" |
5386 | 116 |
echo |
117 |
echo " ISABELLE_USEDIR_OPTIONS=$ISABELLE_USEDIR_OPTIONS" |
|
2902 | 118 |
fi |
2789 | 119 |
|
120 |
||
2879 | 121 |
# check logics |
2755 | 122 |
|
2902 | 123 |
if [ -z "$BATCH" ]; then |
124 |
echo |
|
125 |
echo |
|
9817 | 126 |
echo "Press RETURN to compilation of" |
2902 | 127 |
echo |
128 |
fi |
|
2879 | 129 |
|
4457 | 130 |
|
131 |
MAKE_LOGICS="" |
|
2879 | 132 |
|
4457 | 133 |
for L in $LOGICS |
134 |
do |
|
9789 | 135 |
DIR="$ISABELLE_HOME/src/$L" |
136 |
if [ -f "$DIR/IsaMakefile" ]; then |
|
4457 | 137 |
MAKE_LOGICS="$MAKE_LOGICS $L" |
138 |
else |
|
139 |
echo "No such logic: $L" |
|
140 |
fi |
|
141 |
done |
|
142 |
||
2879 | 143 |
|
2902 | 144 |
if [ -z "$BATCH" ]; then |
9789 | 145 |
echo " $MAKE_LOGICS" |
9817 | 146 |
[ -n "$TARGETS" ] && echo " (targets:$TARGETS)" |
2902 | 147 |
echo |
148 |
read |
|
149 |
else |
|
150 |
echo |
|
9789 | 151 |
echo "Isabelle build: $MAKE_LOGICS" |
9817 | 152 |
[ -n "$TARGETS" ] && echo "(targets:$TARGETS)" |
2914 | 153 |
echo |
2902 | 154 |
echo "ML_SYSTEM=$ML_SYSTEM" |
155 |
echo "ML_HOME=$ML_HOME" |
|
156 |
echo "ML_OPTIONS=$ML_OPTIONS" |
|
7311 | 157 |
echo "ML_PLATFORM=$ML_PLATFORM" |
2902 | 158 |
echo |
5393 | 159 |
echo "ISABELLE_USEDIR_OPTIONS=$ISABELLE_USEDIR_OPTIONS" |
160 |
echo |
|
2902 | 161 |
fi |
2755 | 162 |
|
163 |
||
2879 | 164 |
# build it |
165 |
||
4457 | 166 |
SECONDS=0 |
10511 | 167 |
echo "Started at $(date) ($ML_IDENTIFIER on $(hostname))" |
2914 | 168 |
|
4457 | 169 |
for L in $MAKE_LOGICS |
2755 | 170 |
do |
14056 | 171 |
( cd "$ISABELLE_HOME/src/$L"; "$ISATOOL" make $TARGETS ) |
2755 | 172 |
done |
2902 | 173 |
|
2914 | 174 |
echo -n "Finished at "; date |
4457 | 175 |
|
9789 | 176 |
ELAPSED=$("$ISABELLE_HOME/lib/scripts/showtime" "$SECONDS") |
4457 | 177 |
echo "$ELAPSED total elapsed time" |