2755
|
1 |
#!/bin/bash -norc
|
|
2 |
#
|
|
3 |
# $Id$
|
|
4 |
#
|
|
5 |
# build - compile parts of the Isabelle system
|
|
6 |
|
|
7 |
|
2789
|
8 |
## settings
|
|
9 |
|
|
10 |
PRG=$(basename $0)
|
2755
|
11 |
|
2789
|
12 |
ISABELLE_HOME=$(dirname $0)
|
|
13 |
. $ISABELLE_HOME/lib/scripts/getsettings || \
|
|
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"
|
|
26 |
echo
|
|
27 |
echo " Compile the named LOGICS (default $DEFAULT_LOGIC), or all object logics"
|
|
28 |
echo " in the distribution."
|
|
29 |
echo
|
|
30 |
exit 1
|
|
31 |
}
|
|
32 |
|
|
33 |
function fail()
|
|
34 |
{
|
|
35 |
echo "$1" >&2
|
|
36 |
exit 2
|
|
37 |
}
|
|
38 |
|
|
39 |
|
|
40 |
## process command line
|
|
41 |
|
|
42 |
# options
|
|
43 |
|
|
44 |
ALL=""
|
2755
|
45 |
|
2879
|
46 |
while getopts "a" OPT
|
|
47 |
do
|
|
48 |
case "$OPT" in
|
|
49 |
a)
|
|
50 |
ALL=true
|
|
51 |
;;
|
|
52 |
\?)
|
|
53 |
usage
|
|
54 |
;;
|
|
55 |
esac
|
|
56 |
done
|
|
57 |
|
|
58 |
shift $(($OPTIND - 1))
|
|
59 |
|
|
60 |
|
|
61 |
# args
|
|
62 |
|
|
63 |
LOGICS="$@"
|
|
64 |
|
|
65 |
|
|
66 |
## main
|
|
67 |
|
|
68 |
# tell the user about current values
|
|
69 |
|
|
70 |
echo
|
|
71 |
echo " *****************************"
|
|
72 |
echo " * Welcome to Isabelle build *"
|
|
73 |
echo " *****************************"
|
2755
|
74 |
echo
|
2789
|
75 |
echo "Please check $ISABELLE_HOME/etc/settings"
|
|
76 |
[ -f $ISABELLE_HOME_USER/etc/settings ] && echo "AND $ISABELLE_HOME_USER/etc/settings"
|
2755
|
77 |
echo "to make sure that Isabelle's ML system settings are appropriate."
|
2879
|
78 |
echo
|
2755
|
79 |
echo "Your current values are:"
|
|
80 |
echo
|
|
81 |
|
2879
|
82 |
echo " ML_SYSTEM=$ML_SYSTEM"
|
|
83 |
echo " ML_HOME=$ML_HOME"
|
|
84 |
echo " ML_OPTIONS=$ML_OPTIONS"
|
2789
|
85 |
|
|
86 |
|
2879
|
87 |
# check logics
|
2755
|
88 |
|
|
89 |
echo
|
2761
|
90 |
echo
|
2879
|
91 |
echo "Press RETURN to start compilation (including parents) of:"
|
|
92 |
echo
|
|
93 |
|
|
94 |
[ -z "$LOGICS" ] && LOGICS=$DEFAULT_LOGIC
|
|
95 |
|
|
96 |
if [ -n "$ALL" ]; then
|
|
97 |
LOGICS=""
|
|
98 |
for DIR in $ISABELLE_HOME/src/*
|
|
99 |
do
|
|
100 |
if [ -f $DIR/IsaMakefile ]; then
|
|
101 |
L=$(basename $DIR)
|
|
102 |
LOGICS="$LOGICS $L"
|
|
103 |
fi
|
|
104 |
done
|
|
105 |
else
|
|
106 |
for L in $LOGICS
|
|
107 |
do
|
|
108 |
DIR=$ISABELLE_HOME/src/$L
|
|
109 |
[ ! -f $DIR/IsaMakefile ] && fail "No such logic: $L"
|
|
110 |
done
|
|
111 |
fi
|
|
112 |
|
|
113 |
echo " " $LOGICS
|
|
114 |
echo
|
2755
|
115 |
read
|
|
116 |
|
|
117 |
|
2879
|
118 |
# build it
|
|
119 |
|
2781
|
120 |
export THIS_IS_ISABELLE_BUILD=true
|
2755
|
121 |
|
2879
|
122 |
for L in $LOGICS
|
2755
|
123 |
do
|
2879
|
124 |
( cd $ISABELLE_HOME/src/$L; $ISATOOL make )
|
2755
|
125 |
done
|