src/HOL/Makefile
author nipkow
Fri Nov 17 19:41:20 1995 +0100 (1995-11-17)
changeset 1343 8770c062b092
parent 1336 38d66830a046
child 1350 5bf4a54ba25f
permissions -rw-r--r--
Added Lex
     1 # $Id$
     2 #########################################################################
     3 #									#
     4 # 			Makefile for Isabelle (HOL)			#
     5 #									#
     6 #########################################################################
     7 
     8 #To make the system, cd to this directory and type  
     9 #	make
    10 #To make the system and test it on standard examples, type  
    11 #	make test
    12 #To generate HTML files for every theory, set the environment variable
    13 #MAKE_HTML or add the parameter "MAKE_HTML=".
    14 
    15 #Environment variable ISABELLECOMP specifies the compiler.
    16 #Environment variable ISABELLEBIN specifies the destination directory.
    17 #For Poly/ML, ISABELLEBIN must begin with a /
    18 
    19 #Makes pure Isabelle (Pure) if this file is ABSENT -- but not 
    20 #if it is out of date, since this Makefile does not know its dependencies!
    21 
    22 BIN = $(ISABELLEBIN)
    23 COMP = $(ISABELLECOMP)
    24 NAMES = HOL Ord Set Fun subset equalities Prod Relation Trancl Sum WF \
    25        mono Lfp Gfp Nat Inductive Finite Arith Sexp Univ List 
    26 
    27 FILES = ROOT.ML add_ind_def.ML datatype.ML hologic.ML\
    28 	ind_syntax.ML indrule.ML intr_elim.ML simpdata.ML\
    29 	subtype.ML thy_syntax.ML ../Pure/section_utils.ML\
    30 	../Provers/hypsubst.ML ../Provers/classical.ML\
    31         ../Provers/simplifier.ML ../Provers/splitter.ML\
    32  	$(NAMES:%=%.thy) $(NAMES:%=%.ML)
    33 
    34 $(BIN)/HOL:   $(BIN)/Pure  $(FILES) 
    35 	if [ -d $${ISABELLEBIN:?}/Pure ];\
    36            	then echo Bad value for ISABELLEBIN: \
    37                 	$(BIN) is the Isabelle source directory; \
    38                 	exit 1; \
    39            	fi;\
    40 	case "$(COMP)" in \
    41 	poly*)	echo 'make_database"$(BIN)/HOL"; quit();'  \
    42 		  | $(COMP) $(BIN)/Pure;\
    43 		if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    44                 then echo 'open PolyML; init_html (); exit_use"ROOT";' \
    45                   | $(COMP) $(BIN)/HOL;\
    46 		else echo 'open PolyML; exit_use"ROOT";' | $(COMP) $(BIN)/HOL;\
    47                 fi;;\
    48 	sml*)	if [ "$${MAKE_HTML-undefined}" != "undefined" ];\
    49                 then echo 'init_html (); exit_use"ROOT.ML";                                               xML"$(BIN)/HOL" banner;' | $(BIN)/Pure;\
    50                 else echo 'exit_use"ROOT.ML"; xML"$(BIN)/HOL" banner;' \
    51                        | $(BIN)/Pure;\
    52                 fi;;\
    53 	*)	echo Bad value for ISABELLECOMP: \
    54                 	$(COMP) is not poly or sml; exit 1;;\
    55 	esac
    56 
    57 $(BIN)/Pure:
    58 	cd ../Pure;  $(MAKE)
    59 
    60 #### Testing of HOL
    61 
    62 #A macro referring to the object-logic (depends on ML compiler)
    63 LOGIC:sh=case $ISABELLECOMP in \
    64 	poly*)	echo "$ISABELLECOMP $ISABELLEBIN/HOL" ;;\
    65 	sml*)	echo "$ISABELLEBIN/HOL" ;;\
    66 	*)	echo "echo Bad value for ISABELLECOMP: \
    67                 	$ISABELLEBIN is not poly or sml; exit 1" ;;\
    68 	esac
    69 
    70 ##IMP-semantics example
    71 IMP_NAMES = Com Denotation Equiv Properties
    72 IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
    73 
    74 IMP:    $(BIN)/HOL  $(IMP_FILES)
    75 	echo 'exit_use"IMP/ROOT.ML";quit();' | $(LOGIC)
    76 
    77 ##Hoare logic
    78 Hoare_NAMES = Hoare Arith2 Examples
    79 Hoare_FILES = Hoare/ROOT.ML $(Hoare_NAMES:%=Hoare/%.thy) $(Hoare_NAMES:%=Hoare/%.ML)
    80 
    81 Hoare:  $(BIN)/HOL  $(Hoare_FILES)
    82 	echo 'exit_use"Hoare/ROOT.ML";quit();' | $(LOGIC)
    83 
    84 ##The integers in HOL
    85 INTEG_NAMES = Equiv Integ 
    86 
    87 INTEG_FILES = Integ/ROOT.ML \
    88               $(INTEG_NAMES:%=Integ/%.thy) $(INTEG_NAMES:%=Integ/%.ML)
    89 
    90 Integ:  $(BIN)/HOL  $(INTEG_FILES)
    91 	echo 'exit_use"Integ/ROOT.ML";quit();' | $(LOGIC)
    92 
    93 ##I/O Automata
    94 IOA_NTP_NAMES = Abschannel Action Correctness Impl Lemmas Multiset Packet\
    95                 Receiver Sender
    96 IOA_ABP_NAMES = Action Correctness Lemmas
    97 IOA_MT_NAMES = Asig IOA Option Solve
    98 
    99 IOA_FILES = IOA/ROOT_NTP.ML IOA/ROOT_ABP.ML IOA/NTP/Spec.thy\
   100  $(IOA_NTP_NAMES:%=IOA/NTP/%.thy) $(IOA_NTP_NAMES:%=IOA/NTP/%.ML)\
   101  IOA/ABP/Abschannel.thy IOA/ABP/Abschannel_finite.thy IOA/ABP/Env.thy\
   102  IOA/ABP/Impl.thy IOA/ABP/Impl_finite.thy IOA/ABP/Packet.thy\
   103  IOA/ABP/Receiver.thy IOA/ABP/Sender.thy IOA/ABP/Spec.thy\
   104  $(IOA_ABP_NAMES:%=IOA/ABP/%.thy) $(IOA_ABP_NAMES:%=IOA/ABP/%.ML)\
   105  $(IOA_MT_NAMES:%=IOA/meta_theory/%.thy) $(IOA_MT_NAMES:%=IOA/meta_theory/%.ML)
   106 
   107 IOA:    $(BIN)/HOL  $(IOA_FILES)
   108 	echo 'exit_use"IOA/ROOT_NTP.ML";quit();' | $(LOGIC)
   109 #	echo 'exit_use"IOA/ROOT_ABP.ML";quit();' | $(LOGIC)
   110 
   111 ##Properties of substitutions
   112 SUBST_NAMES = AList Setplus Subst Unifier UTerm UTLemmas
   113 
   114 SUBST_FILES = Subst/ROOT.ML \
   115               $(SUBST_NAMES:%=Subst/%.thy) $(SUBST_NAMES:%=Subst/%.ML)
   116 
   117 Subst:  $(BIN)/HOL  $(SUBST_FILES)
   118 	echo 'exit_use"Subst/ROOT.ML";quit();' | $(LOGIC)
   119 
   120 ##Confluence of Lambda-calculus
   121 LAMBDA_NAMES = Lambda ParRed Commutation Eta
   122 
   123 LAMBDA_FILES = Lambda/ROOT.ML \
   124               $(LAMBDA_NAMES:%=Lambda/%.thy) $(LAMBDA_NAMES:%=Lambda/%.ML)
   125 
   126 Lambda:	$(BIN)/HOL  $(LAMBDA_FILES)
   127 	echo 'exit_use"Lambda/ROOT.ML";quit();' | $(LOGIC)
   128 
   129 ##Type inference for MiniML
   130 MINIML_NAMES = I Maybe MiniML Type W
   131 
   132 MINIML_FILES = MiniML/ROOT.ML \
   133               $(MINIML_NAMES:%=MiniML/%.thy) $(MINIML_NAMES:%=MiniML/%.ML)
   134 
   135 MiniML:	$(BIN)/HOL  $(MINIML_FILES)
   136 	echo 'exit_use"MiniML/ROOT.ML";quit();' | $(LOGIC)
   137 
   138 ##Lexical analysis
   139 LEX_FILES = Auto AutoChopper Chopper Prefix
   140 
   141 LEX_FILES = Lex/ROOT.ML \
   142             $(LEX_NAMES:%=Lex/%.thy) $(LEX_NAMES:%=Lex/%.ML)
   143 
   144 Lex:	$(BIN)/HOL  $(LEX_FILES)
   145 	echo 'exit_use"Lex/ROOT.ML";quit();' | $(LOGIC)
   146 
   147 ##Miscellaneous examples
   148 EX_NAMES = LexProd MT Acc PropLog Puzzle Qsort LList Rec Simult Term String \
   149 	   BT Perm
   150 
   151 EX_FILES = ex/ROOT.ML ex/cla.ML ex/meson.ML ex/mesontest.ML ex/rel.ML \
   152            ex/set.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
   153 
   154 ex:     $(BIN)/HOL  $(EX_FILES)
   155 	echo 'exit_use"ex/ROOT.ML";quit();' | $(LOGIC)
   156 
   157 #Full test.
   158 test:   $(BIN)/HOL IMP Hoare Lex Integ Subst Lambda MiniML IOA ex
   159 	echo 'Test examples ran successfully' > test
   160 
   161 .PRECIOUS:  $(BIN)/Pure $(BIN)/HOL