remove old output heaps, to ensure that result is valid wrt. check_stamps;
tuned signature;
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 1 ]; then
36 elif [ "$#" -eq 2 ]; then
46 # get compatibility file
48 ML_SYSTEM_BASE=$(echo "$ML_SYSTEM" | cut -f1 -d-)
49 [ -z "$ML_SYSTEM" ] && fail "Missing ML_SYSTEM settings!"
52 [ -f "ML-Systems/${ML_SYSTEM_BASE}.ML" ] && COMPAT="ML-Systems/${ML_SYSTEM_BASE}.ML"
53 [ -f "ML-Systems/${ML_SYSTEM}.ML" ] && COMPAT="ML-Systems/${ML_SYSTEM}.ML"
54 [ -z "$COMPAT" ] && fail "Missing compatibility file for ML system \"$ML_SYSTEM\"!"
59 . "$ISABELLE_HOME/lib/scripts/timestart.bash"
61 if [ "$TARGET" = RAW ]; then
62 if [ -z "$OUTPUT" ]; then
64 -e "use\"$COMPAT\" handle _ => OS.Process.exit OS.Process.failure;" \
68 -e "use\"$COMPAT\" handle _ => OS.Process.exit OS.Process.failure;" \
69 -e "structure Isar = struct fun main () = () end;" \
70 -e "ml_prompts \"ML> \" \"ML# \";" \
71 -q -w RAW_ML_SYSTEM "$OUTPUT"
74 if [ -z "$OUTPUT" ]; then
76 -e "(use\"$COMPAT\"; use\"ROOT.ML\") handle _ => OS.Process.exit OS.Process.failure;" \
80 -e "(use\"$COMPAT\"; use\"ROOT.ML\") handle _ => OS.Process.exit OS.Process.failure;" \
81 -e "ml_prompts \"ML> \" \"ML# \";" \
82 -f -q -w RAW_ML_SYSTEM "$OUTPUT"
88 . "$ISABELLE_HOME/lib/scripts/timestop.bash"
90 if [ "$RC" -eq 0 ]; then
91 echo "Finished $TARGET ($TIMES_REPORT)" >&2