src/HOL/Makefile
author paulson
Fri Apr 18 11:47:36 1997 +0200 (1997-04-18)
changeset 2982 85c81d524655
parent 2921 aee40b88a0ad
child 3079 2ea678d3523f
permissions -rw-r--r--
ex/LFilter is a new theory (and dependency)
     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 intr_elim indrule Inductive Finite Arith \
    26 	Sexp Univ List RelPow Option
    27 
    28 FILES = ROOT.ML add_ind_def.ML datatype.ML hologic.ML\
    29 	ind_syntax.ML cladata.ML simpdata.ML\
    30 	typedef.ML thy_syntax.ML thy_data.ML ../Pure/section_utils.ML\
    31 	../Provers/hypsubst.ML ../Provers/classical.ML ../Provers/blast.ML \
    32 	../Provers/simplifier.ML ../Provers/splitter.ML\
    33 	../Provers/nat_transitive.ML \
    34 	$(NAMES:%=%.thy) $(NAMES:%=%.ML)
    35 
    36 $(BIN)/HOL:   $(BIN)/Pure  $(FILES) 
    37 	@if [ -d $${ISABELLEBIN:?}/Pure ];\
    38 		then echo Bad value for ISABELLEBIN: \
    39 			$(BIN) is the Isabelle source directory; \
    40 			exit 1; \
    41 	fi
    42 	@case `basename "$(COMP)"` in \
    43 	poly*)	echo 'make_database"$(BIN)/HOL"; quit();'  \
    44 		  | $(COMP) $(BIN)/Pure;\
    45 		if [ "$${MAKE_HTML}" = "true" ]; \
    46 		then echo 'open PolyML; make_html := true; exit_use_dir".";' \
    47 		       | $(COMP) $(BIN)/HOL;\
    48 		elif [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    49 		then echo 'open PolyML; make_html := true; exit_use_dir".";				  make_html := false;' | $(COMP) $(BIN)/HOL;\
    50 		else echo 'open PolyML; exit_use_dir".";' \
    51 		       | $(COMP) $(BIN)/HOL;\
    52 		fi;\
    53 		discgarb -c $(BIN)/HOL;;\
    54 	sml*)	if [ "$${MAKE_HTML}" = "true" ]; \
    55 		then echo 'make_html := true; exit_use_dir".";						  xML"$(BIN)/HOL" banner;' | $(BIN)/Pure;\
    56 		elif [ "$${MAKE_HTML-undefined}" != "undefined" ];\
    57 		then echo 'make_html := true; exit_use_dir".";						  make_html := false; xML"$(BIN)/HOL" banner;' \
    58 		       | $(BIN)/Pure;\
    59 		else echo 'exit_use_dir"."; xML"$(BIN)/HOL" banner;' \
    60 		       | $(BIN)/Pure;\
    61 		fi;;\
    62 	*)	echo Bad value for ISABELLECOMP: \
    63 			\"$(COMP)\" is not poly or sml; exit 1;;\
    64 	esac
    65 
    66 $(BIN)/Pure:
    67 	cd ../Pure;  $(MAKE)
    68 
    69 #### Testing of HOL
    70 
    71 #A macro referring to the object-logic (depends on ML compiler)
    72 #	[Thanks to Thomas Santen and Stephan Herrmann from GMD First]
    73 LOGIC=`case \`basename "$(ISABELLECOMP)"\` in \
    74 	poly*)	echo "$(ISABELLECOMP) $(ISABELLEBIN)/HOL" ;;\
    75 	sml*)	echo "$(ISABELLEBIN)/HOL" ;;\
    76 	*)	echo "echo; echo Bad value for ISABELLECOMP: \
    77 			$(ISABELLECOMP) is not poly or sml; exit 1" ;;\
    78 	esac`
    79 
    80 ##TFL (requires integration into HOL proper)
    81 TFL_NAMES = mask tfl thms thry usyntax utils
    82 TFL_FILES = ../TFL/ROOT.ML ../TFL/sys.sml \
    83             $(TFL_NAMES:%=../TFL/%.sig) $(TFL_NAMES:%=../TFL/%.sml)
    84 
    85 TFL:	$(BIN)/HOL  $(TFL_FILES)
    86 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    87 	then echo 'make_html:= true; exit_use_dir"../TFL";quit();' | $(LOGIC);\
    88 	else echo 'exit_use_dir"../TFL";quit();' | $(LOGIC); \
    89 	fi
    90 
    91 ##IMP-semantics example
    92 IMP_NAMES = Expr Com Natural Transition Denotation Hoare VC
    93 IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
    94 
    95 IMP:	$(BIN)/HOL  $(IMP_FILES)
    96 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    97 	then echo 'make_html := true; exit_use_dir"IMP";quit();' | $(LOGIC); \
    98 	else echo 'exit_use_dir"IMP";quit();' | $(LOGIC); \
    99 	fi
   100 
   101 ##Hoare logic
   102 Hoare_NAMES = Hoare Arith2 Examples
   103 Hoare_FILES = Hoare/ROOT.ML $(Hoare_NAMES:%=Hoare/%.thy) \
   104 	      $(Hoare_NAMES:%=Hoare/%.ML)
   105 
   106 Hoare:	$(BIN)/HOL  $(Hoare_FILES)
   107 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   108 	then echo 'make_html := true; exit_use_dir"Hoare";quit();' | $(LOGIC);\
   109 	else echo 'exit_use_dir"Hoare";quit();' | $(LOGIC); \
   110 	fi
   111 
   112 ##The integers in HOL
   113 INTEG_NAMES = Equiv Integ Group Ring Lagrange IntRingDefs IntRing
   114 
   115 INTEG_FILES = Integ/ROOT.ML \
   116 	      $(INTEG_NAMES:%=Integ/%.thy) $(INTEG_NAMES:%=Integ/%.ML)
   117 
   118 Integ:	$(BIN)/HOL  $(INTEG_FILES)
   119 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   120 	then echo 'make_html := true; exit_use_dir"Integ";quit();' | $(LOGIC);\
   121 	else echo 'exit_use_dir"Integ";quit();' | $(LOGIC); \
   122 	fi
   123 
   124 ##I/O Automata
   125 IOA_NTP_NAMES = Abschannel Action Correctness Impl Lemmas Multiset Packet\
   126 		Receiver Sender
   127 IOA_ABP_NAMES = Action Correctness Lemmas
   128 IOA_MT_NAMES = Asig IOA Solve
   129 
   130 IOA_FILES = IOA/NTP/ROOT.ML IOA/ABP/ROOT.ML IOA/NTP/Spec.thy\
   131  $(IOA_NTP_NAMES:%=IOA/NTP/%.thy) $(IOA_NTP_NAMES:%=IOA/NTP/%.ML)\
   132  IOA/ABP/Abschannel.thy IOA/ABP/Abschannel_finite.thy IOA/ABP/Env.thy\
   133  IOA/ABP/Impl.thy IOA/ABP/Impl_finite.thy IOA/ABP/Packet.thy\
   134  IOA/ABP/Receiver.thy IOA/ABP/Sender.thy IOA/ABP/Spec.thy\
   135  $(IOA_ABP_NAMES:%=IOA/ABP/%.thy) $(IOA_ABP_NAMES:%=IOA/ABP/%.ML)\
   136  $(IOA_MT_NAMES:%=IOA/meta_theory/%.thy) $(IOA_MT_NAMES:%=IOA/meta_theory/%.ML)
   137 
   138 IOA:	$(BIN)/HOL  $(IOA_FILES)
   139 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   140 	then echo 'make_html := true; exit_use_dir"IOA/NTP";quit();' \
   141 	       | $(LOGIC);\
   142 	     echo 'make_html := true; exit_use_dir"IOA/ABP";quit();' \
   143 	       | $(LOGIC);\
   144 	else echo 'exit_use_dir"IOA/NTP";quit();' | $(LOGIC); \
   145 	     echo 'exit_use_dir"IOA/ABP";quit();' | $(LOGIC); \
   146 	fi
   147 
   148 
   149 ##Authentication & Security Protocols
   150 Auth_NAMES = Message Shared NS_Shared OtwayRees OtwayRees_AN OtwayRees_Bad \
   151 	     Recur WooLam Yahalom Yahalom2 Public NS_Public_Bad NS_Public
   152 
   153 AUTH_FILES = Auth/ROOT.ML $(AUTH_NAMES:%=Auth/%.thy) $(AUTH_NAMES:%=Auth/%.ML)
   154 
   155 Auth:	$(BIN)/HOL  $(AUTH_FILES)
   156 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   157 	then echo 'make_html := true; exit_use_dir"Auth";quit();' | $(LOGIC);\
   158 	else echo 'exit_use_dir"Auth";quit();' | $(LOGIC); \
   159 	fi
   160 
   161 
   162 ##Properties of substitutions
   163 SUBST_NAMES = AList Setplus Subst Unifier UTerm UTLemmas
   164 
   165 SUBST_FILES = Subst/ROOT.ML \
   166 	      $(SUBST_NAMES:%=Subst/%.thy) $(SUBST_NAMES:%=Subst/%.ML)
   167 
   168 Subst:	$(BIN)/HOL  $(SUBST_FILES)
   169 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   170 	then echo 'make_html := true; exit_use_dir"Subst";quit();' | $(LOGIC);\
   171 	else echo 'exit_use_dir"Subst";quit();' | $(LOGIC); \
   172 	fi
   173 
   174 ##Confluence of Lambda-calculus
   175 LAMBDA_NAMES = Lambda ParRed Commutation Eta
   176 
   177 LAMBDA_FILES = Lambda/ROOT.ML \
   178 	      $(LAMBDA_NAMES:%=Lambda/%.thy) $(LAMBDA_NAMES:%=Lambda/%.ML)
   179 
   180 Lambda:	 $(BIN)/HOL $(LAMBDA_FILES)
   181 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   182 	then echo 'make_html := true; exit_use_dir"Lambda";quit();' \
   183 	       | $(LOGIC);\
   184 	else echo 'exit_use_dir"Lambda";quit();' | $(LOGIC); \
   185 	fi
   186 
   187 ## Type inference without let
   188 
   189 W0_NAMES = I Maybe MiniML Type W
   190 
   191 W0_FILES = W0/ROOT.ML \
   192 	      $(W0_NAMES:%=W0/%.thy) $(W0_NAMES:%=W0/%.ML)
   193 
   194 W0:	$(BIN)/HOL  $(W0_FILES)
   195 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   196 	then echo 'make_html := true; exit_use_dir"W0";quit();' \
   197 	       | $(LOGIC);\
   198 	else echo 'exit_use_dir"W0";quit();' | $(LOGIC); \
   199 	fi
   200 
   201 ## Type inference with let
   202 
   203 MINIML_NAMES = Generalize Instance Maybe MiniML Type W
   204 
   205 MINIML_FILES = MiniML/ROOT.ML \
   206 	      $(MINIML_NAMES:%=MiniML/%.thy) $(MINIML_NAMES:%=MiniML/%.ML)
   207 
   208 MiniML: $(BIN)/HOL  $(MINIML_FILES)
   209 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   210 	then echo 'make_html := true; exit_use_dir"MiniML";quit();' \
   211 	       | $(LOGIC);\
   212 	else echo 'exit_use_dir"MiniML";quit();' | $(LOGIC); \
   213 	fi
   214 
   215 ##Lexical analysis
   216 LEX_FILES = Auto AutoChopper Chopper Prefix
   217 
   218 LEX_FILES = Lex/ROOT.ML \
   219 	    $(LEX_NAMES:%=Lex/%.thy) $(LEX_NAMES:%=Lex/%.ML)
   220 
   221 Lex:	$(BIN)/HOL  $(LEX_FILES)
   222 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   223 	then echo 'make_html := true; exit_use_dir"Lex";quit();' | $(LOGIC);\
   224 	else echo 'exit_use_dir"Lex";quit();' | $(LOGIC); \
   225 	fi
   226 
   227 ##Miscellaneous examples
   228 EX_NAMES = String BT Perm Comb InSort Qsort LexProd Puzzle Mutil \
   229 	   Primes NatSum SList LList LFilter Acc PropLog Term Simult MT
   230 
   231 EX_FILES = ex/ROOT.ML ex/cla.ML ex/meson.ML ex/mesontest.ML ex/rel.ML \
   232 	   ex/set.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
   233 
   234 ex:	$(BIN)/HOL  $(EX_FILES)
   235 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   236 	then echo 'make_html := true; exit_use_dir"ex";quit();' | $(LOGIC);\
   237 	else echo 'exit_use_dir"ex";quit();' | $(LOGIC); \
   238 	fi
   239 
   240 #Full test.
   241 test:	$(BIN)/HOL TFL IMP Hoare Lex Integ Auth Subst Lambda MiniML IOA ex
   242 	echo 'Test examples ran successfully' > test
   243 
   244 .PRECIOUS:  $(BIN)/Pure $(BIN)/HOL