3 # Author: Markus Wenzel, TU Muenchen
5 # mk - build Isabelle/Pure.
7 # Requires proper Isabelle settings environment.
15 echo "Usage: $PRG [OPTIONS]"
17 echo " Make Pure Isabelle."
19 echo " -R DIR/FILE run RAW session"
20 echo " -r build RAW image"
32 ## process command line
39 while getopts "R:r" OPT
54 shift $(($OPTIND - 1))
59 [ "$#" -ne 0 ] && usage
64 # get compatibility file
66 ML_SYSTEM_BASE=$(echo "$ML_SYSTEM" | cut -f1 -d-)
67 [ -z "$ML_SYSTEM" ] && fail "Missing ML_SYSTEM settings!"
70 [ -f "ML-Systems/$ML_SYSTEM_BASE.ML" ] && COMPAT="ML-Systems/$ML_SYSTEM_BASE.ML"
71 [ -f "ML-Systems/$ML_SYSTEM.ML" ] && COMPAT="ML-Systems/$ML_SYSTEM.ML"
72 [ -z "$COMPAT" ] && fail "Missing compatibility file for ML system \"$ML_SYSTEM\"!"
77 LOGDIR="$ISABELLE_OUTPUT/log"
83 . "$ISABELLE_HOME/lib/scripts/timestart.bash"
85 if [ -n "$RAW" ]; then
87 echo "Building $ITEM ..."
91 -e "use\"$COMPAT\" handle _ => exit 1;" \
92 -e "structure Isar = struct fun main () = () end;" \
93 -e "ml_prompts \"ML> \" \"ML# \";" \
94 -q -w RAW_ML_SYSTEM RAW > "$LOG" 2>&1
96 elif [ -n "$RAW_SESSION" ]; then
97 ITEM="RAW-$(basename $(dirname "$RAW_SESSION"))"
98 echo "Running $ITEM ..."
101 "$ISABELLE_PROCESS" \
102 -e "use\"$RAW_SESSION\" handle _ => exit 1;" \
107 echo "Building $ITEM ..."
110 "$ISABELLE_PROCESS" \
111 -e "(use\"$COMPAT\"; use\"ROOT.ML\") handle _ => exit 1;" \
112 -e "ml_prompts \"ML> \" \"ML# \";" \
113 -f -q -w RAW_ML_SYSTEM Pure > "$LOG" 2>&1
117 . "$ISABELLE_HOME/lib/scripts/timestop.bash"
122 if [ "$RC" -eq 0 ]; then
123 echo "Finished $ITEM ($TIMES_REPORT)"
127 echo "(see also $LOG)"
128 echo; tail "$LOG"; echo