src/Pure/mk
author wenzelm
Tue, 07 Jan 1997 09:01:52 +0100
changeset 2474 9990f088d7ac
parent 2432 527b5f1b7520
child 2768 bc6d915b8019
permissions -rwxr-xr-x
minor tuning;

#!/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 SYSTEM Pure

chmod -w $ISABELLE_OUTPUT_DIR/Pure