src/Pure/mk
author wenzelm
Wed, 16 Apr 1997 18:17:38 +0200
changeset 2960 a6b56d03ed0d
parent 2768 bc6d915b8019
child 3056 200565f7592a
permissions -rwxr-xr-x
added sorts.ML, type_infer.ML;

#!/bin/bash -norc
#
# $Id$
#
# mk - build Pure Isabelle.
#
# Assumes to be called via Isabelle make utility (cf. IsaMakefile).


## diagnostics

function fail()
{
  echo "$1" >&2
  exit 2
}


## main

ML_SYSTEM_BASE=$(echo $ML_SYSTEM | cut -f1 -d-)
[ -z "$ML_SYSTEM" ] && fail "Missing ML system settings! Probably not run via 'isatool make'?."

COMPAT=""
[ -f "ML-Systems/$ML_SYSTEM_BASE.ML" ] && COMPAT="ML-Systems/$ML_SYSTEM_BASE.ML"
[ -f "ML-Systems/$ML_SYSTEM.ML" ] && COMPAT="ML-Systems/$ML_SYSTEM.ML"
[ -z "$COMPAT" ] && fail "Missing compatibility file for ML system \"$ML_SYSTEM\"!"

$ISABELLE \
  -e "val ml_system = \"$ML_SYSTEM\";" \
  -e "use\"$COMPAT\"; use\"ROOT.ML\" handle _ => exit 1;" \
  -cq RAW_ML_SYSTEM Pure

chmod -w $ISABELLE_OUTPUT_DIR/Pure