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