author | paulson |
Fri, 17 Oct 1997 11:00:50 +0200 | |
changeset 3913 | 96e28b16861c |
parent 3255 | 7678f3d93053 |
child 4457 | 6e6d99e06d0c |
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 |
||
2789 | 8 |
## settings |
9 |
||
10 |
PRG=$(basename $0) |
|
2755 | 11 |
|
2789 | 12 |
ISABELLE_HOME=$(dirname $0) |
13 |
. $ISABELLE_HOME/lib/scripts/getsettings || \ |
|
2936
bd33e7aae062
fixed { ... } shell syntax to accomodate bash 2.x;
wenzelm
parents:
2918
diff
changeset
|
14 |
{ echo "$PRG probably not called from its original place!"; exit 2; } |
2755 | 15 |
|
2789 | 16 |
|
2879 | 17 |
## diagnostics |
18 |
||
19 |
function usage() |
|
20 |
{ |
|
21 |
echo |
|
22 |
echo "Usage: $PRG [OPTIONS] [LOGICS ...]" |
|
23 |
echo |
|
24 |
echo " Options are:" |
|
25 |
echo " -a all logics" |
|
2902 | 26 |
echo " -b batch mode" |
2918 | 27 |
echo " -t run tests" |
2879 | 28 |
echo |
3184 | 29 |
echo " Compile the named LOGICS (default $ISABELLE_LOGIC), or all object logics" |
2879 | 30 |
echo " in the distribution." |
31 |
echo |
|
32 |
exit 1 |
|
33 |
} |
|
34 |
||
35 |
function fail() |
|
36 |
{ |
|
37 |
echo "$1" >&2 |
|
38 |
exit 2 |
|
39 |
} |
|
40 |
||
41 |
||
42 |
## process command line |
|
43 |
||
44 |
# options |
|
45 |
||
46 |
ALL="" |
|
2902 | 47 |
BATCH="" |
2918 | 48 |
TEST="" |
2755 | 49 |
|
2918 | 50 |
while getopts "abt" OPT |
2879 | 51 |
do |
52 |
case "$OPT" in |
|
53 |
a) |
|
54 |
ALL=true |
|
55 |
;; |
|
2902 | 56 |
b) |
57 |
BATCH=true |
|
58 |
;; |
|
2918 | 59 |
t) |
60 |
TEST=test |
|
61 |
;; |
|
2879 | 62 |
\?) |
63 |
usage |
|
64 |
;; |
|
65 |
esac |
|
66 |
done |
|
67 |
||
68 |
shift $(($OPTIND - 1)) |
|
69 |
||
70 |
||
71 |
# args |
|
72 |
||
73 |
LOGICS="$@" |
|
74 |
||
75 |
||
76 |
## main |
|
77 |
||
78 |
# tell the user about current values |
|
79 |
||
2902 | 80 |
if [ -z "$BATCH" ]; then |
81 |
echo |
|
82 |
echo " *****************************" |
|
83 |
echo " * Welcome to Isabelle build *" |
|
84 |
echo " *****************************" |
|
85 |
echo |
|
86 |
echo "Please check $ISABELLE_HOME/etc/settings" |
|
87 |
[ -f $ISABELLE_HOME_USER/etc/settings ] && echo "AND $ISABELLE_HOME_USER/etc/settings" |
|
88 |
echo "to make sure that Isabelle's ML system settings are appropriate." |
|
89 |
echo |
|
90 |
echo "Your current values are:" |
|
91 |
echo |
|
92 |
echo " ML_SYSTEM=$ML_SYSTEM" |
|
93 |
echo " ML_HOME=$ML_HOME" |
|
94 |
echo " ML_OPTIONS=$ML_OPTIONS" |
|
95 |
fi |
|
2789 | 96 |
|
97 |
||
2879 | 98 |
# check logics |
2755 | 99 |
|
2902 | 100 |
if [ -z "$BATCH" ]; then |
101 |
echo |
|
102 |
echo |
|
103 |
echo "Press RETURN to start compilation (including parents) of:" |
|
104 |
echo |
|
105 |
fi |
|
2879 | 106 |
|
3184 | 107 |
[ -z "$LOGICS" ] && LOGICS=$ISABELLE_LOGIC |
2879 | 108 |
|
109 |
if [ -n "$ALL" ]; then |
|
110 |
LOGICS="" |
|
111 |
for DIR in $ISABELLE_HOME/src/* |
|
112 |
do |
|
113 |
if [ -f $DIR/IsaMakefile ]; then |
|
114 |
L=$(basename $DIR) |
|
115 |
LOGICS="$LOGICS $L" |
|
116 |
fi |
|
117 |
done |
|
118 |
else |
|
119 |
for L in $LOGICS |
|
120 |
do |
|
121 |
DIR=$ISABELLE_HOME/src/$L |
|
122 |
[ ! -f $DIR/IsaMakefile ] && fail "No such logic: $L" |
|
123 |
done |
|
124 |
fi |
|
125 |
||
2902 | 126 |
if [ -z "$BATCH" ]; then |
127 |
echo " " $LOGICS |
|
128 |
echo |
|
129 |
read |
|
130 |
else |
|
131 |
echo |
|
2914 | 132 |
echo "Isabelle build:" $LOGICS |
133 |
echo |
|
2902 | 134 |
echo "ML_SYSTEM=$ML_SYSTEM" |
135 |
echo "ML_HOME=$ML_HOME" |
|
136 |
echo "ML_OPTIONS=$ML_OPTIONS" |
|
137 |
echo |
|
138 |
fi |
|
2755 | 139 |
|
140 |
||
2879 | 141 |
# build it |
142 |
||
2914 | 143 |
echo |
144 |
echo -n "Started at "; date |
|
145 |
echo |
|
146 |
||
2781 | 147 |
export THIS_IS_ISABELLE_BUILD=true |
2755 | 148 |
|
2879 | 149 |
for L in $LOGICS |
2755 | 150 |
do |
2918 | 151 |
( cd $ISABELLE_HOME/src/$L; $ISATOOL make $TEST ) |
2755 | 152 |
done |
2902 | 153 |
|
2914 | 154 |
echo |
155 |
echo -n "Finished at "; date |
|
156 |
echo |