src/HOL/Makefile
author nipkow
Fri Nov 29 15:07:27 1996 +0100 (1996-11-29)
changeset 2279 2f337bf81085
parent 2274 1b1b46adc9b3
child 2329 55060cfeda1b
permissions -rw-r--r--
Modified dependencies for ex and Integ. (Rings)
     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\
    32 	../Provers/simplifier.ML ../Provers/splitter.ML\
    33 	$(NAMES:%=%.thy) $(NAMES:%=%.ML)
    34 
    35 $(BIN)/HOL:   $(BIN)/Pure  $(FILES) 
    36 	@if [ -d $${ISABELLEBIN:?}/Pure ];\
    37 		then echo Bad value for ISABELLEBIN: \
    38 			$(BIN) is the Isabelle source directory; \
    39 			exit 1; \
    40 	fi
    41 	@case `basename "$(COMP)"` in \
    42 	poly*)	echo 'make_database"$(BIN)/HOL"; quit();'  \
    43 		  | $(COMP) $(BIN)/Pure;\
    44 		if [ "$${MAKE_HTML}" = "true" ]; \
    45 		then echo 'open PolyML; make_html := true; exit_use_dir".";' \
    46 		       | $(COMP) $(BIN)/HOL;\
    47 		elif [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    48 		then echo 'open PolyML; make_html := true; exit_use_dir".";				  make_html := false;' | $(COMP) $(BIN)/HOL;\
    49 		else echo 'open PolyML; exit_use_dir".";' \
    50 		       | $(COMP) $(BIN)/HOL;\
    51 		fi;\
    52 		discgarb -c $(BIN)/HOL;;\
    53 	sml*)	if [ "$${MAKE_HTML}" = "true" ]; \
    54 		then echo 'make_html := true; exit_use_dir".";						  xML"$(BIN)/HOL" banner;' | $(BIN)/Pure;\
    55 		elif [ "$${MAKE_HTML-undefined}" != "undefined" ];\
    56 		then echo 'make_html := true; exit_use_dir".";						  make_html := false; xML"$(BIN)/HOL" banner;' \
    57 		       | $(BIN)/Pure;\
    58 		else echo 'exit_use_dir"."; xML"$(BIN)/HOL" banner;' \
    59 		       | $(BIN)/Pure;\
    60 		fi;;\
    61 	*)	echo Bad value for ISABELLECOMP: \
    62 			\"$(COMP)\" is not poly or sml; exit 1;;\
    63 	esac
    64 
    65 $(BIN)/Pure:
    66 	cd ../Pure;  $(MAKE)
    67 
    68 #### Testing of HOL
    69 
    70 #A macro referring to the object-logic (depends on ML compiler)
    71 #	[Thanks to Thomas Santen and Stephan Herrmann from GMD First]
    72 LOGIC=`case \`basename "$(ISABELLECOMP)"\` in \
    73 	poly*)	echo "$(ISABELLECOMP) $(ISABELLEBIN)/HOL" ;;\
    74 	sml*)	echo "$(ISABELLEBIN)/HOL" ;;\
    75 	*)	echo "echo; echo Bad value for ISABELLECOMP: \
    76 			$(ISABELLECOMP) is not poly or sml; exit 1" ;;\
    77 	esac`
    78 
    79 ##IMP-semantics example
    80 IMP_NAMES = Expr Com Natural Transition Denotation Hoare VC
    81 IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
    82 
    83 IMP:	$(BIN)/HOL  $(IMP_FILES)
    84 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    85 	then echo 'make_html := true; exit_use_dir"IMP";quit();' | $(LOGIC); \
    86 	else echo 'exit_use_dir"IMP";quit();' | $(LOGIC); \
    87 	fi
    88 
    89 ##Hoare logic
    90 Hoare_NAMES = Hoare Arith2 Examples
    91 Hoare_FILES = Hoare/ROOT.ML $(Hoare_NAMES:%=Hoare/%.thy) \
    92 	      $(Hoare_NAMES:%=Hoare/%.ML)
    93 
    94 Hoare:	$(BIN)/HOL  $(Hoare_FILES)
    95 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    96 	then echo 'make_html := true; exit_use_dir"Hoare";quit();' | $(LOGIC);\
    97 	else echo 'exit_use_dir"Hoare";quit();' | $(LOGIC); \
    98 	fi
    99 
   100 ##The integers in HOL
   101 INTEG_NAMES = Equiv Integ Group Ring Lagrange IntRingDefs IntRing
   102 
   103 INTEG_FILES = Integ/ROOT.ML \
   104 	      $(INTEG_NAMES:%=Integ/%.thy) $(INTEG_NAMES:%=Integ/%.ML)
   105 
   106 Integ:	$(BIN)/HOL  $(INTEG_FILES)
   107 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   108 	then echo 'make_html := true; exit_use_dir"Integ";quit();' | $(LOGIC);\
   109 	else echo 'exit_use_dir"Integ";quit();' | $(LOGIC); \
   110 	fi
   111 
   112 ##I/O Automata
   113 IOA_NTP_NAMES = Abschannel Action Correctness Impl Lemmas Multiset Packet\
   114 		Receiver Sender
   115 IOA_ABP_NAMES = Action Correctness Lemmas
   116 IOA_MT_NAMES = Asig IOA Solve
   117 
   118 IOA_FILES = IOA/NTP/ROOT.ML IOA/ABP/ROOT.ML IOA/NTP/Spec.thy\
   119  $(IOA_NTP_NAMES:%=IOA/NTP/%.thy) $(IOA_NTP_NAMES:%=IOA/NTP/%.ML)\
   120  IOA/ABP/Abschannel.thy IOA/ABP/Abschannel_finite.thy IOA/ABP/Env.thy\
   121  IOA/ABP/Impl.thy IOA/ABP/Impl_finite.thy IOA/ABP/Packet.thy\
   122  IOA/ABP/Receiver.thy IOA/ABP/Sender.thy IOA/ABP/Spec.thy\
   123  $(IOA_ABP_NAMES:%=IOA/ABP/%.thy) $(IOA_ABP_NAMES:%=IOA/ABP/%.ML)\
   124  $(IOA_MT_NAMES:%=IOA/meta_theory/%.thy) $(IOA_MT_NAMES:%=IOA/meta_theory/%.ML)
   125 
   126 IOA:	$(BIN)/HOL  $(IOA_FILES)
   127 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   128 	then echo 'make_html := true; exit_use_dir"IOA/NTP";quit();' \
   129 	       | $(LOGIC);\
   130 	     echo 'make_html := true; exit_use_dir"IOA/ABP";quit();' \
   131 	       | $(LOGIC);\
   132 	else echo 'exit_use_dir"IOA/NTP";quit();' | $(LOGIC); \
   133 	     echo 'exit_use_dir"IOA/ABP";quit();' | $(LOGIC); \
   134 	fi
   135 
   136 
   137 ##Authentication & Security Protocols
   138 Auth_NAMES = Message Shared NS_Shared OtwayRees OtwayRees_AN OtwayRees_Bad \
   139 	     WooLam Yahalom Yahalom2
   140 
   141 AUTH_FILES = Auth/ROOT.ML $(AUTH_NAMES:%=Auth/%.thy) $(AUTH_NAMES:%=Auth/%.ML)
   142 
   143 Auth:	$(BIN)/HOL  $(AUTH_FILES)
   144 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   145 	then echo 'make_html := true; exit_use_dir"Auth";quit();' | $(LOGIC);\
   146 	else echo 'exit_use_dir"Auth";quit();' | $(LOGIC); \
   147 	fi
   148 
   149 
   150 ##Properties of substitutions
   151 SUBST_NAMES = AList Setplus Subst Unifier UTerm UTLemmas
   152 
   153 SUBST_FILES = Subst/ROOT.ML \
   154 	      $(SUBST_NAMES:%=Subst/%.thy) $(SUBST_NAMES:%=Subst/%.ML)
   155 
   156 Subst:	$(BIN)/HOL  $(SUBST_FILES)
   157 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   158 	then echo 'make_html := true; exit_use_dir"Subst";quit();' | $(LOGIC);\
   159 	else echo 'exit_use_dir"Subst";quit();' | $(LOGIC); \
   160 	fi
   161 
   162 ##Confluence of Lambda-calculus
   163 LAMBDA_NAMES = Lambda ParRed Commutation Eta
   164 
   165 LAMBDA_FILES = Lambda/ROOT.ML \
   166 	      $(LAMBDA_NAMES:%=Lambda/%.thy) $(LAMBDA_NAMES:%=Lambda/%.ML)
   167 
   168 Lambda:	 $(BIN)/HOL $(LAMBDA_FILES)
   169 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   170 	then echo 'make_html := true; exit_use_dir"Lambda";quit();' \
   171 	       | $(LOGIC);\
   172 	else echo 'exit_use_dir"Lambda";quit();' | $(LOGIC); \
   173 	fi
   174 
   175 ##Type inference for MiniML
   176 MINIML_NAMES = I Maybe MiniML Type W
   177 
   178 MINIML_FILES = MiniML/ROOT.ML \
   179 	      $(MINIML_NAMES:%=MiniML/%.thy) $(MINIML_NAMES:%=MiniML/%.ML)
   180 
   181 MiniML: $(BIN)/HOL  $(MINIML_FILES)
   182 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   183 	then echo 'make_html := true; exit_use_dir"MiniML";quit();' \
   184 	       | $(LOGIC);\
   185 	else echo 'exit_use_dir"MiniML";quit();' | $(LOGIC); \
   186 	fi
   187 
   188 ##Lexical analysis
   189 LEX_FILES = Auto AutoChopper Chopper Prefix
   190 
   191 LEX_FILES = Lex/ROOT.ML \
   192 	    $(LEX_NAMES:%=Lex/%.thy) $(LEX_NAMES:%=Lex/%.ML)
   193 
   194 Lex:	$(BIN)/HOL  $(LEX_FILES)
   195 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   196 	then echo 'make_html := true; exit_use_dir"Lex";quit();' | $(LOGIC);\
   197 	else echo 'exit_use_dir"Lex";quit();' | $(LOGIC); \
   198 	fi
   199 
   200 ##Miscellaneous examples
   201 EX_NAMES = String BT Perm Comb InSort Qsort LexProd \
   202 	   Puzzle Mutil Primes NatSum SList LList Acc PropLog Term Simult MT
   203 
   204 EX_FILES = ex/ROOT.ML ex/cla.ML ex/meson.ML ex/mesontest.ML ex/rel.ML \
   205 	   ex/set.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
   206 
   207 ex:	$(BIN)/HOL  $(EX_FILES)
   208 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   209 	then echo 'make_html := true; exit_use_dir"ex";quit();' | $(LOGIC);\
   210 	else echo 'exit_use_dir"ex";quit();' | $(LOGIC); \
   211 	fi
   212 
   213 #Full test.
   214 test:	$(BIN)/HOL IMP Hoare Lex Integ Auth Subst Lambda MiniML IOA ex
   215 	echo 'Test examples ran successfully' > test
   216 
   217 .PRECIOUS:  $(BIN)/Pure $(BIN)/HOL