src/HOL/Makefile
author wenzelm
Thu Jan 23 14:19:16 1997 +0100 (1997-01-23)
changeset 2545 d10abc8c11fb
parent 2534 7a876fc091d6
child 2889 a86f3b5f3cc7
permissions -rw-r--r--
added AxClasses test;
     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 ##TFL (requires integration into HOL proper)
    80 TFL_NAMES = mask tfl thms thry usyntax utils
    81 TFL_FILES = ../TFL/ROOT.ML ../TFL/sys.sml \
    82             $(TFL_NAMES:%=../TFL/%.sig) $(TFL_NAMES:%=../TFL/%.sml)
    83 
    84 TFL:	$(BIN)/HOL  $(TFL_FILES)
    85 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    86 	then echo 'make_html:= true; exit_use_dir"../TFL";quit();' | $(LOGIC);\
    87 	else echo 'exit_use_dir"../TFL";quit();' | $(LOGIC); \
    88 	fi
    89 
    90 ##IMP-semantics example
    91 IMP_NAMES = Expr Com Natural Transition Denotation Hoare VC
    92 IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
    93 
    94 IMP:	$(BIN)/HOL  $(IMP_FILES)
    95 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    96 	then echo 'make_html := true; exit_use_dir"IMP";quit();' | $(LOGIC); \
    97 	else echo 'exit_use_dir"IMP";quit();' | $(LOGIC); \
    98 	fi
    99 
   100 ##Hoare logic
   101 Hoare_NAMES = Hoare Arith2 Examples
   102 Hoare_FILES = Hoare/ROOT.ML $(Hoare_NAMES:%=Hoare/%.thy) \
   103 	      $(Hoare_NAMES:%=Hoare/%.ML)
   104 
   105 Hoare:	$(BIN)/HOL  $(Hoare_FILES)
   106 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   107 	then echo 'make_html := true; exit_use_dir"Hoare";quit();' | $(LOGIC);\
   108 	else echo 'exit_use_dir"Hoare";quit();' | $(LOGIC); \
   109 	fi
   110 
   111 ##The integers in HOL
   112 INTEG_NAMES = Equiv Integ Group Ring Lagrange IntRingDefs IntRing
   113 
   114 INTEG_FILES = Integ/ROOT.ML \
   115 	      $(INTEG_NAMES:%=Integ/%.thy) $(INTEG_NAMES:%=Integ/%.ML)
   116 
   117 Integ:	$(BIN)/HOL  $(INTEG_FILES)
   118 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   119 	then echo 'make_html := true; exit_use_dir"Integ";quit();' | $(LOGIC);\
   120 	else echo 'exit_use_dir"Integ";quit();' | $(LOGIC); \
   121 	fi
   122 
   123 ##I/O Automata
   124 IOA_NTP_NAMES = Abschannel Action Correctness Impl Lemmas Multiset Packet\
   125 		Receiver Sender
   126 IOA_ABP_NAMES = Action Correctness Lemmas
   127 IOA_MT_NAMES = Asig IOA Solve
   128 
   129 IOA_FILES = IOA/NTP/ROOT.ML IOA/ABP/ROOT.ML IOA/NTP/Spec.thy\
   130  $(IOA_NTP_NAMES:%=IOA/NTP/%.thy) $(IOA_NTP_NAMES:%=IOA/NTP/%.ML)\
   131  IOA/ABP/Abschannel.thy IOA/ABP/Abschannel_finite.thy IOA/ABP/Env.thy\
   132  IOA/ABP/Impl.thy IOA/ABP/Impl_finite.thy IOA/ABP/Packet.thy\
   133  IOA/ABP/Receiver.thy IOA/ABP/Sender.thy IOA/ABP/Spec.thy\
   134  $(IOA_ABP_NAMES:%=IOA/ABP/%.thy) $(IOA_ABP_NAMES:%=IOA/ABP/%.ML)\
   135  $(IOA_MT_NAMES:%=IOA/meta_theory/%.thy) $(IOA_MT_NAMES:%=IOA/meta_theory/%.ML)
   136 
   137 IOA:	$(BIN)/HOL  $(IOA_FILES)
   138 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   139 	then echo 'make_html := true; exit_use_dir"IOA/NTP";quit();' \
   140 	       | $(LOGIC);\
   141 	     echo 'make_html := true; exit_use_dir"IOA/ABP";quit();' \
   142 	       | $(LOGIC);\
   143 	else echo 'exit_use_dir"IOA/NTP";quit();' | $(LOGIC); \
   144 	     echo 'exit_use_dir"IOA/ABP";quit();' | $(LOGIC); \
   145 	fi
   146 
   147 
   148 ##Authentication & Security Protocols
   149 Auth_NAMES = Message Shared NS_Shared OtwayRees OtwayRees_AN OtwayRees_Bad \
   150 	     Recur WooLam Yahalom Yahalom2 Public NS_Public_Bad NS_Public
   151 
   152 AUTH_FILES = Auth/ROOT.ML $(AUTH_NAMES:%=Auth/%.thy) $(AUTH_NAMES:%=Auth/%.ML)
   153 
   154 Auth:	$(BIN)/HOL  $(AUTH_FILES)
   155 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   156 	then echo 'make_html := true; exit_use_dir"Auth";quit();' | $(LOGIC);\
   157 	else echo 'exit_use_dir"Auth";quit();' | $(LOGIC); \
   158 	fi
   159 
   160 
   161 ##Properties of substitutions
   162 SUBST_NAMES = AList Setplus Subst Unifier UTerm UTLemmas
   163 
   164 SUBST_FILES = Subst/ROOT.ML \
   165 	      $(SUBST_NAMES:%=Subst/%.thy) $(SUBST_NAMES:%=Subst/%.ML)
   166 
   167 Subst:	$(BIN)/HOL  $(SUBST_FILES)
   168 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   169 	then echo 'make_html := true; exit_use_dir"Subst";quit();' | $(LOGIC);\
   170 	else echo 'exit_use_dir"Subst";quit();' | $(LOGIC); \
   171 	fi
   172 
   173 ##Confluence of Lambda-calculus
   174 LAMBDA_NAMES = Lambda ParRed Commutation Eta
   175 
   176 LAMBDA_FILES = Lambda/ROOT.ML \
   177 	      $(LAMBDA_NAMES:%=Lambda/%.thy) $(LAMBDA_NAMES:%=Lambda/%.ML)
   178 
   179 Lambda:	 $(BIN)/HOL $(LAMBDA_FILES)
   180 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   181 	then echo 'make_html := true; exit_use_dir"Lambda";quit();' \
   182 	       | $(LOGIC);\
   183 	else echo 'exit_use_dir"Lambda";quit();' | $(LOGIC); \
   184 	fi
   185 
   186 ## Type inference without let
   187 
   188 W0_NAMES = I Maybe MiniML Type W
   189 
   190 W0_FILES = W0/ROOT.ML \
   191 	      $(W0_NAMES:%=W0/%.thy) $(W0_NAMES:%=W0/%.ML)
   192 
   193 W0:	$(BIN)/HOL  $(W0_FILES)
   194 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   195 	then echo 'make_html := true; exit_use_dir"W0";quit();' \
   196 	       | $(LOGIC);\
   197 	else echo 'exit_use_dir"W0";quit();' | $(LOGIC); \
   198 	fi
   199 
   200 ## Type inference with let
   201 
   202 MINIML_NAMES = Generalize Instance Maybe MiniML Type W
   203 
   204 MINIML_FILES = MiniML/ROOT.ML \
   205 	      $(MINIML_NAMES:%=MiniML/%.thy) $(MINIML_NAMES:%=MiniML/%.ML)
   206 
   207 MiniML: $(BIN)/HOL  $(MINIML_FILES)
   208 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   209 	then echo 'make_html := true; exit_use_dir"MiniML";quit();' \
   210 	       | $(LOGIC);\
   211 	else echo 'exit_use_dir"MiniML";quit();' | $(LOGIC); \
   212 	fi
   213 
   214 ##Lexical analysis
   215 LEX_FILES = Auto AutoChopper Chopper Prefix
   216 
   217 LEX_FILES = Lex/ROOT.ML \
   218 	    $(LEX_NAMES:%=Lex/%.thy) $(LEX_NAMES:%=Lex/%.ML)
   219 
   220 Lex:	$(BIN)/HOL  $(LEX_FILES)
   221 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   222 	then echo 'make_html := true; exit_use_dir"Lex";quit();' | $(LOGIC);\
   223 	else echo 'exit_use_dir"Lex";quit();' | $(LOGIC); \
   224 	fi
   225 
   226 ##Miscellaneous examples
   227 EX_NAMES = String BT Perm Comb InSort Qsort LexProd \
   228 	   Puzzle Mutil Primes NatSum SList LList Acc PropLog Term Simult MT
   229 
   230 EX_FILES = ex/ROOT.ML ex/cla.ML ex/meson.ML ex/mesontest.ML ex/rel.ML \
   231 	   ex/set.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
   232 
   233 ex:	$(BIN)/HOL  $(EX_FILES)
   234 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   235 	then echo 'make_html := true; exit_use_dir"ex";quit();' | $(LOGIC);\
   236 	else echo 'exit_use_dir"ex";quit();' | $(LOGIC); \
   237 	fi
   238 
   239 #Full test.
   240 test:	$(BIN)/HOL TFL IMP Hoare Lex Integ Auth Subst Lambda MiniML IOA ex
   241 	echo 'Test examples ran successfully' > test
   242 
   243 .PRECIOUS:  $(BIN)/Pure $(BIN)/HOL