#########################################################################
#									#
# 	Makefile for Isabelle (Constructive Type Theory)		#
#									#
#########################################################################

#To make the Type Theory system, cd to this directory and type  "make BASE"
#This will make pure Isabelle on (..) if necessary.

#This will make pure Isabelle (../BASE) if this file is ABSENT -- but not 
#if it is out of date, since this Makefile does not know its dependencies!
#Note that Poly/ML sometimes updates ../BASE so that it appears more recent
#than it really is, forcing a needless remake of BASE.

#To make the system and test it on standard examples, type "make test".

#This Makefile is for the Poly/ML compiler.  It should be easy to adapt to
#other implementations of Standard ML.

#WARNING: Isabelle databases are created by make_database, 
#         thus may fail if copied or moved!

DRIVER = poly #Uses the standard DBASE to make root version

ML_FILES = 	ROOT.ML  syntax.ML  .rules.ML  resolve.ML\
		bool.ML  arith.ML   rew.ML


test:   ex/ROOT.ML BASE
	echo 'PolyML.use "ex/ROOT";'  |  $(DRIVER) BASE 

BASE:   ../BASE  $(ML_FILES) 
	echo 'make_database("CTT", "BASE");  quit();' | $(DRIVER) ../BASE
	echo 'PolyML.use "ROOT";'  |  $(DRIVER) BASE 

../BASE:
	cd ..;  $(MAKE) DRIVER=$(DRIVER)  BASE

#Note that .rules.ML should not be edited: it is derived from ruleshell.ML
.rules.ML: ruleshell.ML
	../make-rulenames .

.PRECIOUS:  BASE 
