#########################################################################
# #
# Makefile for Isabelle (ZF) #
# #
#########################################################################
#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 FOL 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)
NAMES = ZF upair subset pair domrange \
func AC simpdata equalities Bool \
Sum QPair mono Fixedpt ind_syntax add_ind_def \
constructor intr_elim indrule Inductive Perm Rel EquivClass Trancl \
WF Order Ordinal Epsilon Arith Univ \
QUniv Datatype OrderArith OrderType \
Cardinal CardinalArith Cardinal_AC InfDatatype \
Zorn Nat Finite List
FILES = ROOT.ML thy_syntax.ML ../Pure/section_utils.ML \
$(NAMES:%=%.thy) $(NAMES:%=%.ML)
#Uses cp rather than make_database because Poly/ML allows only 3 levels
$(BIN)/ZF: $(BIN)/FOL $(FILES)
case "$(COMP)" in \
poly*) cp $(BIN)/FOL $(BIN)/ZF;\
echo 'open PolyML; exit_use"ROOT";' | $(COMP) $(BIN)/ZF ;;\
sml*) echo 'exit_use"ROOT.ML"; xML"$(BIN)/ZF" banner;' | $(BIN)/FOL;;\
*) echo Bad value for ISABELLECOMP: \
$(COMP) is not poly or sml; exit 1;;\
esac
$(BIN)/FOL:
cd ../FOL; $(MAKE)
#### Testing of ZF
#A macro referring to the object-logic (depends on ML compiler)
LOGIC:sh=case $ISABELLECOMP in \
poly*) echo "$ISABELLECOMP $ISABELLEBIN/ZF" ;;\
sml*) echo "$ISABELLEBIN/ZF" ;;\
*) echo "echo Bad value for ISABELLECOMP: \
$ISABELLEBIN is not poly or sml; exit 1" ;;\
esac
##IMP-semantics example
IMP_NAMES = Com Denotation Equiv
IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
IMP: $(BIN)/ZF $(IMP_FILES)
echo 'exit_use"IMP/ROOT.ML";quit();' | $(LOGIC)
##Coinduction example
COIND_NAMES = ECR Language MT Map Static Types Values
COIND_FILES = Coind/ROOT.ML Coind/BCR.thy Coind/Dynamic.thy \
$(COIND_NAMES:%=Coind/%.thy) $(COIND_NAMES:%=Coind/%.ML)
Coind: $(BIN)/ZF $(COIND_FILES)
echo 'exit_use"Coind/ROOT.ML";quit();' | $(LOGIC)
##AC examples
AC_NAMES = AC_Equiv OrdQuant Transrec2 WO6_WO1 rel_is_fun
AC_FILES = AC/ROOT.ML $(AC_NAMES:%=AC/%.thy) $(AC_NAMES:%=AC/%.ML)
AC: $(BIN)/ZF $(AC_FILES)
echo 'exit_use"AC/ROOT.ML";quit();' | $(LOGIC)
##Miscellaneous examples
EX_NAMES = Ramsey Integ twos_compl Bin BT Term TF Ntree Brouwer Data Enum \
Rmap PropLog ListN Acc Comb Primrec LList CoUnit
EX_FILES = ex/ROOT.ML ex/misc.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
#Test ZF by loading the examples in directory ex
ex: $(BIN)/ZF $(EX_FILES)
echo 'exit_use"ex/ROOT.ML";quit();' | $(LOGIC)
#Full test.
test: $(BIN)/ZF IMP Coind AC ex
echo 'Test examples ran successfully' > test
.PRECIOUS: $(BIN)/FOL $(BIN)/ZF