#########################################################################
#									#
# 			Makefile for Isabelle (HOL)			#
#									#
#########################################################################

#To make the system, cd to this directory and type  
#	make -f Makefile 
#To make the system and test it on standard examples, type  
#	make -f Makefile test

#Environment variable ISABELLECOMP specifies the compiler.
#Environment variable ISABELLEBIN specifies the destination directory.
#For Poly/ML, ISABELLEBIN must begin with a /

#Makes pure Isabelle (Pure) if this file is ABSENT -- but not 
#if it is out of date, since this Makefile does not know its dependencies!

BIN = $(ISABELLEBIN)
COMP = $(ISABELLECOMP)
FILES = ROOT.ML hol.thy hol.ML simpdata.ML \
	fun.ML set.thy set.ML subset.ML equalities.ML \
	prod.thy prod.ML sum.thy sum.ML wf.thy wf.ML \
	mono.ML lfp.thy lfp.ML nat.thy nat.ML sexp.thy \
	sexp.ML univ.thy univ.ML list.thy list.ML \
	../Provers/classical.ML ../Provers/simp.ML ../Provers/ind.ML

$(BIN)/HOL:   $(BIN)/Pure  $(FILES) 
	case "$(COMP)" in \
	poly*)	echo 'make_database"$(BIN)/HOL"; quit();'  \
			| $(COMP) $(BIN)/Pure;\
		echo 'open PolyML; use"ROOT";' | $(COMP) $(BIN)/HOL ;;\
	sml*)	echo 'use"ROOT.ML"; xML"$(BIN)/HOL" banner;' | $(BIN)/Pure ;;\
	*)	echo Bad value for ISABELLECOMP;;\
	esac

$(BIN)/Pure:
	cd ../Pure;  $(MAKE)

test:   ex/ROOT.ML  $(BIN)/HOL
	case "$(COMP)" in \
	poly*)	echo 'use"ex/ROOT.ML";' | $(COMP) $(BIN)/HOL ;;\
	sml*)	echo 'use"ex/ROOT.ML"; xML"$(BIN)/HOL" banner;' | $(BIN)/HOL;;\
	*)	echo Bad value for ISABELLECOMP;;\
	esac

.PRECIOUS:  $(BIN)/Pure  $(BIN)/HOL 
