5 # build - build Isabelle/ML
7 # Requires proper Isabelle settings environment.
15 echo "Usage: $PRG TARGET OUTPUT"
26 [ -z "$ISABELLE_HOME" ] && fail "Missing Isabelle settings environment"
29 ## process command line
33 if [ "$#" -eq 2 ]; then
43 # get compatibility file
45 ML_SYSTEM_BASE=$(echo "$ML_SYSTEM" | cut -f1 -d-)
46 [ -z "$ML_SYSTEM" ] && fail "Missing ML_SYSTEM settings!"
49 [ -f "ML-Systems/${ML_SYSTEM_BASE}.ML" ] && COMPAT="ML-Systems/${ML_SYSTEM_BASE}.ML"
50 [ -f "ML-Systems/${ML_SYSTEM}.ML" ] && COMPAT="ML-Systems/${ML_SYSTEM}.ML"
51 [ -z "$COMPAT" ] && fail "Missing compatibility file for ML system \"$ML_SYSTEM\"!"
56 . "$ISABELLE_HOME/lib/scripts/timestart.bash"
58 if [ "$TARGET" = RAW ]; then
59 if [ -z "$OUTPUT" ]; then
61 -e "use\"$COMPAT\" handle _ => OS.Process.exit OS.Process.failure;" \
65 -e "use\"$COMPAT\" handle _ => OS.Process.exit OS.Process.failure;" \
66 -e "structure Isar = struct fun main () = () end;" \
67 -e "ml_prompts \"ML> \" \"ML# \";" \
68 -q -w RAW_ML_SYSTEM "$OUTPUT"
71 if [ -z "$OUTPUT" ]; then
73 -e "(use\"$COMPAT\"; use\"ROOT.ML\") handle _ => OS.Process.exit OS.Process.failure;" \
77 -e "(use\"$COMPAT\"; use\"ROOT.ML\") handle _ => OS.Process.exit OS.Process.failure;" \
78 -e "ml_prompts \"ML> \" \"ML# \";" \
79 -f -q -w RAW_ML_SYSTEM "$OUTPUT"
85 . "$ISABELLE_HOME/lib/scripts/timestop.bash"
87 if [ "$RC" -eq 0 ]; then
88 echo "Finished $TARGET ($TIMES_REPORT)" >&2