3056
|
1 |
#!/bin/bash
|
2339
|
2 |
#
|
|
3 |
# $Id$
|
|
4 |
#
|
|
5 |
# mk - build Pure Isabelle.
|
|
6 |
#
|
2432
|
7 |
# Assumes to be called via Isabelle make utility (cf. IsaMakefile).
|
2339
|
8 |
|
|
9 |
|
|
10 |
## diagnostics
|
|
11 |
|
|
12 |
function fail()
|
|
13 |
{
|
|
14 |
echo "$1" >&2
|
|
15 |
exit 2
|
|
16 |
}
|
|
17 |
|
|
18 |
|
|
19 |
## main
|
|
20 |
|
|
21 |
ML_SYSTEM_BASE=$(echo $ML_SYSTEM | cut -f1 -d-)
|
3056
|
22 |
[ -z "$ML_SYSTEM" ] && \
|
|
23 |
fail "Missing ML system settings! Probably not run via 'isatool make'?."
|
2339
|
24 |
|
|
25 |
COMPAT=""
|
|
26 |
[ -f "ML-Systems/$ML_SYSTEM_BASE.ML" ] && COMPAT="ML-Systems/$ML_SYSTEM_BASE.ML"
|
|
27 |
[ -f "ML-Systems/$ML_SYSTEM.ML" ] && COMPAT="ML-Systems/$ML_SYSTEM.ML"
|
|
28 |
[ -z "$COMPAT" ] && fail "Missing compatibility file for ML system \"$ML_SYSTEM\"!"
|
|
29 |
|
2474
|
30 |
$ISABELLE \
|
2401
|
31 |
-e "val ml_system = \"$ML_SYSTEM\";" \
|
|
32 |
-e "use\"$COMPAT\"; use\"ROOT.ML\" handle _ => exit 1;" \
|
3056
|
33 |
-q RAW_ML_SYSTEM Pure
|
2432
|
34 |
|
3118
|
35 |
chmod -w $ISABELLE_OUTPUT/Pure
|