src/HOL/Makefile
changeset 2117 292df12bace5
parent 2094 2061df98aab5
child 2235 866dbb04816c
equal deleted inserted replaced
2116:73bbf2cc7651 2117:292df12bace5
    31 	../Provers/hypsubst.ML ../Provers/classical.ML\
    31 	../Provers/hypsubst.ML ../Provers/classical.ML\
    32 	../Provers/simplifier.ML ../Provers/splitter.ML\
    32 	../Provers/simplifier.ML ../Provers/splitter.ML\
    33 	$(NAMES:%=%.thy) $(NAMES:%=%.ML)
    33 	$(NAMES:%=%.thy) $(NAMES:%=%.ML)
    34 
    34 
    35 $(BIN)/HOL:   $(BIN)/Pure  $(FILES) 
    35 $(BIN)/HOL:   $(BIN)/Pure  $(FILES) 
    36 	if [ -d $${ISABELLEBIN:?}/Pure ];\
    36 	@if [ -d $${ISABELLEBIN:?}/Pure ];\
    37 		then echo Bad value for ISABELLEBIN: \
    37 		then echo Bad value for ISABELLEBIN: \
    38 			$(BIN) is the Isabelle source directory; \
    38 			$(BIN) is the Isabelle source directory; \
    39 			exit 1; \
    39 			exit 1; \
    40 		fi;\
    40 	fi
    41 	case "$(COMP)" in \
    41 	@case `expr "//$(COMP)" : '[^ ]*/\(.*\)'` in \
    42 	poly*)	echo 'make_database"$(BIN)/HOL"; quit();'  \
    42 	poly*)	echo 'make_database"$(BIN)/HOL"; quit();'  \
    43 		  | $(COMP) $(BIN)/Pure;\
    43 		  | $(COMP) $(BIN)/Pure;\
    44 		if [ "$${MAKE_HTML}" = "true" ]; \
    44 		if [ "$${MAKE_HTML}" = "true" ]; \
    45 		then echo 'open PolyML; make_html := true; exit_use_dir".";' \
    45 		then echo 'open PolyML; make_html := true; exit_use_dir".";' \
    46 		       | $(COMP) $(BIN)/HOL;\
    46 		       | $(COMP) $(BIN)/HOL;\
    57 		       | $(BIN)/Pure;\
    57 		       | $(BIN)/Pure;\
    58 		else echo 'exit_use_dir"."; xML"$(BIN)/HOL" banner;' \
    58 		else echo 'exit_use_dir"."; xML"$(BIN)/HOL" banner;' \
    59 		       | $(BIN)/Pure;\
    59 		       | $(BIN)/Pure;\
    60 		fi;;\
    60 		fi;;\
    61 	*)	echo Bad value for ISABELLECOMP: \
    61 	*)	echo Bad value for ISABELLECOMP: \
    62 			$(COMP) is not poly or sml; exit 1;;\
    62 			\"$(COMP)\" is not poly or sml; exit 1;;\
    63 	esac
    63 	esac
    64 
    64 
    65 $(BIN)/Pure:
    65 $(BIN)/Pure:
    66 	cd ../Pure;  $(MAKE)
    66 	cd ../Pure;  $(MAKE)
    67 
    67 
    68 #### Testing of HOL
    68 #### Testing of HOL
    69 
    69 
    70 #A macro referring to the object-logic (depends on ML compiler)
    70 #A macro referring to the object-logic (depends on ML compiler)
    71 LOGIC:sh=case $ISABELLECOMP in \
    71 LOGIC:sh=case `expr "//$ISABELLECOMP" : '[^ ]*/\(.*\)'` in \
    72 	poly*)	echo "$ISABELLECOMP $ISABELLEBIN/HOL" ;;\
    72 	poly*)	echo "$ISABELLECOMP $ISABELLEBIN/HOL" ;;\
    73 	sml*)	echo "$ISABELLEBIN/HOL" ;;\
    73 	sml*)	echo "$ISABELLEBIN/HOL" ;;\
    74 	*)	echo "echo Bad value for ISABELLECOMP: \
    74 	*)	echo "echo; echo Bad value for ISABELLECOMP: \
    75 			$ISABELLEBIN is not poly or sml; exit 1" ;;\
    75 			$ISABELLECOMP is not poly or sml; exit 1" ;;\
    76 	esac
    76 	esac
    77 
    77 
    78 ##IMP-semantics example
    78 ##IMP-semantics example
    79 IMP_NAMES = Expr Com Natural Transition Denotation Hoare VC
    79 IMP_NAMES = Expr Com Natural Transition Denotation Hoare VC
    80 IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
    80 IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
    81 
    81 
    82 IMP:	$(BIN)/HOL  $(IMP_FILES)
    82 IMP:	$(BIN)/HOL  $(IMP_FILES)
    83 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    83 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    84 	then echo 'make_html := true; exit_use_dir"IMP";quit();' | $(LOGIC); \
    84 	then echo 'make_html := true; exit_use_dir"IMP";quit();' | $(LOGIC); \
    85 	else echo 'exit_use_dir"IMP";quit();' | $(LOGIC); \
    85 	else echo 'exit_use_dir"IMP";quit();' | $(LOGIC); \
    86 	fi
    86 	fi
    87 
    87 
    88 ##Hoare logic
    88 ##Hoare logic
    89 Hoare_NAMES = Hoare Arith2 Examples
    89 Hoare_NAMES = Hoare Arith2 Examples
    90 Hoare_FILES = Hoare/ROOT.ML $(Hoare_NAMES:%=Hoare/%.thy) \
    90 Hoare_FILES = Hoare/ROOT.ML $(Hoare_NAMES:%=Hoare/%.thy) \
    91 	      $(Hoare_NAMES:%=Hoare/%.ML)
    91 	      $(Hoare_NAMES:%=Hoare/%.ML)
    92 
    92 
    93 Hoare:	$(BIN)/HOL  $(Hoare_FILES)
    93 Hoare:	$(BIN)/HOL  $(Hoare_FILES)
    94 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    94 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    95 	then echo 'make_html := true; exit_use_dir"Hoare";quit();' | $(LOGIC);\
    95 	then echo 'make_html := true; exit_use_dir"Hoare";quit();' | $(LOGIC);\
    96 	else echo 'exit_use_dir"Hoare";quit();' | $(LOGIC); \
    96 	else echo 'exit_use_dir"Hoare";quit();' | $(LOGIC); \
    97 	fi
    97 	fi
    98 
    98 
    99 ##The integers in HOL
    99 ##The integers in HOL
   101 
   101 
   102 INTEG_FILES = Integ/ROOT.ML \
   102 INTEG_FILES = Integ/ROOT.ML \
   103 	      $(INTEG_NAMES:%=Integ/%.thy) $(INTEG_NAMES:%=Integ/%.ML)
   103 	      $(INTEG_NAMES:%=Integ/%.thy) $(INTEG_NAMES:%=Integ/%.ML)
   104 
   104 
   105 Integ:	$(BIN)/HOL  $(INTEG_FILES)
   105 Integ:	$(BIN)/HOL  $(INTEG_FILES)
   106 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   106 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   107 	then echo 'make_html := true; exit_use_dir"Integ";quit();' | $(LOGIC);\
   107 	then echo 'make_html := true; exit_use_dir"Integ";quit();' | $(LOGIC);\
   108 	else echo 'exit_use_dir"Integ";quit();' | $(LOGIC); \
   108 	else echo 'exit_use_dir"Integ";quit();' | $(LOGIC); \
   109 	fi
   109 	fi
   110 
   110 
   111 ##I/O Automata
   111 ##I/O Automata
   121  IOA/ABP/Receiver.thy IOA/ABP/Sender.thy IOA/ABP/Spec.thy\
   121  IOA/ABP/Receiver.thy IOA/ABP/Sender.thy IOA/ABP/Spec.thy\
   122  $(IOA_ABP_NAMES:%=IOA/ABP/%.thy) $(IOA_ABP_NAMES:%=IOA/ABP/%.ML)\
   122  $(IOA_ABP_NAMES:%=IOA/ABP/%.thy) $(IOA_ABP_NAMES:%=IOA/ABP/%.ML)\
   123  $(IOA_MT_NAMES:%=IOA/meta_theory/%.thy) $(IOA_MT_NAMES:%=IOA/meta_theory/%.ML)
   123  $(IOA_MT_NAMES:%=IOA/meta_theory/%.thy) $(IOA_MT_NAMES:%=IOA/meta_theory/%.ML)
   124 
   124 
   125 IOA:	$(BIN)/HOL  $(IOA_FILES)
   125 IOA:	$(BIN)/HOL  $(IOA_FILES)
   126 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   126 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   127 	then echo 'make_html := true; exit_use_dir"IOA/NTP";quit();' \
   127 	then echo 'make_html := true; exit_use_dir"IOA/NTP";quit();' \
   128 	       | $(LOGIC);\
   128 	       | $(LOGIC);\
   129 	     echo 'make_html := true; exit_use_dir"IOA/ABP";quit();' \
   129 	     echo 'make_html := true; exit_use_dir"IOA/ABP";quit();' \
   130 	       | $(LOGIC);\
   130 	       | $(LOGIC);\
   131 	else echo 'exit_use_dir"IOA/NTP";quit();' | $(LOGIC); \
   131 	else echo 'exit_use_dir"IOA/NTP";quit();' | $(LOGIC); \
   132 	     echo 'exit_use_dir"IOA/ABP";quit();' | $(LOGIC); \
   132 	     echo 'exit_use_dir"IOA/ABP";quit();' | $(LOGIC); \
   133 	fi
   133 	fi
   134 
   134 
   135 
   135 
   136 ##Authentication & Security Protocols
   136 ##Authentication & Security Protocols
   137 Auth_NAMES = Message Shared NS_Shared OtwayRees OtwayRees_AN Yahalom
   137 Auth_NAMES = Message Shared NS_Shared OtwayRees OtwayRees_AN OtwayRees_Bad \
       
   138 	     Yahalom Yahalom2
   138 
   139 
   139 AUTH_FILES = Auth/ROOT.ML $(AUTH_NAMES:%=Auth/%.thy) $(AUTH_NAMES:%=Auth/%.ML)
   140 AUTH_FILES = Auth/ROOT.ML $(AUTH_NAMES:%=Auth/%.thy) $(AUTH_NAMES:%=Auth/%.ML)
   140 
   141 
   141 Auth:	$(BIN)/HOL  $(AUTH_FILES)
   142 Auth:	$(BIN)/HOL  $(AUTH_FILES)
   142 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   143 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   143 	then echo 'make_html := true; exit_use_dir"Auth";quit();' | $(LOGIC);\
   144 	then echo 'make_html := true; exit_use_dir"Auth";quit();' | $(LOGIC);\
   144 	else echo 'exit_use_dir"Auth";quit();' | $(LOGIC); \
   145 	else echo 'exit_use_dir"Auth";quit();' | $(LOGIC); \
   145 	fi
   146 	fi
   146 
   147 
   147 
   148 
   150 
   151 
   151 SUBST_FILES = Subst/ROOT.ML \
   152 SUBST_FILES = Subst/ROOT.ML \
   152 	      $(SUBST_NAMES:%=Subst/%.thy) $(SUBST_NAMES:%=Subst/%.ML)
   153 	      $(SUBST_NAMES:%=Subst/%.thy) $(SUBST_NAMES:%=Subst/%.ML)
   153 
   154 
   154 Subst:	$(BIN)/HOL  $(SUBST_FILES)
   155 Subst:	$(BIN)/HOL  $(SUBST_FILES)
   155 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   156 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   156 	then echo 'make_html := true; exit_use_dir"Subst";quit();' | $(LOGIC);\
   157 	then echo 'make_html := true; exit_use_dir"Subst";quit();' | $(LOGIC);\
   157 	else echo 'exit_use_dir"Subst";quit();' | $(LOGIC); \
   158 	else echo 'exit_use_dir"Subst";quit();' | $(LOGIC); \
   158 	fi
   159 	fi
   159 
   160 
   160 ##Confluence of Lambda-calculus
   161 ##Confluence of Lambda-calculus
   162 
   163 
   163 LAMBDA_FILES = Lambda/ROOT.ML \
   164 LAMBDA_FILES = Lambda/ROOT.ML \
   164 	      $(LAMBDA_NAMES:%=Lambda/%.thy) $(LAMBDA_NAMES:%=Lambda/%.ML)
   165 	      $(LAMBDA_NAMES:%=Lambda/%.thy) $(LAMBDA_NAMES:%=Lambda/%.ML)
   165 
   166 
   166 Lambda:	 $(BIN)/HOL $(LAMBDA_FILES)
   167 Lambda:	 $(BIN)/HOL $(LAMBDA_FILES)
   167 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   168 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   168 	then echo 'make_html := true; exit_use_dir"Lambda";quit();' \
   169 	then echo 'make_html := true; exit_use_dir"Lambda";quit();' \
   169 	       | $(LOGIC);\
   170 	       | $(LOGIC);\
   170 	else echo 'exit_use_dir"Lambda";quit();' | $(LOGIC); \
   171 	else echo 'exit_use_dir"Lambda";quit();' | $(LOGIC); \
   171 	fi
   172 	fi
   172 
   173 
   175 
   176 
   176 MINIML_FILES = MiniML/ROOT.ML \
   177 MINIML_FILES = MiniML/ROOT.ML \
   177 	      $(MINIML_NAMES:%=MiniML/%.thy) $(MINIML_NAMES:%=MiniML/%.ML)
   178 	      $(MINIML_NAMES:%=MiniML/%.thy) $(MINIML_NAMES:%=MiniML/%.ML)
   178 
   179 
   179 MiniML: $(BIN)/HOL  $(MINIML_FILES)
   180 MiniML: $(BIN)/HOL  $(MINIML_FILES)
   180 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   181 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   181 	then echo 'make_html := true; exit_use_dir"MiniML";quit();' \
   182 	then echo 'make_html := true; exit_use_dir"MiniML";quit();' \
   182 	       | $(LOGIC);\
   183 	       | $(LOGIC);\
   183 	else echo 'exit_use_dir"MiniML";quit();' | $(LOGIC); \
   184 	else echo 'exit_use_dir"MiniML";quit();' | $(LOGIC); \
   184 	fi
   185 	fi
   185 
   186 
   188 
   189 
   189 LEX_FILES = Lex/ROOT.ML \
   190 LEX_FILES = Lex/ROOT.ML \
   190 	    $(LEX_NAMES:%=Lex/%.thy) $(LEX_NAMES:%=Lex/%.ML)
   191 	    $(LEX_NAMES:%=Lex/%.thy) $(LEX_NAMES:%=Lex/%.ML)
   191 
   192 
   192 Lex:	$(BIN)/HOL  $(LEX_FILES)
   193 Lex:	$(BIN)/HOL  $(LEX_FILES)
   193 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   194 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   194 	then echo 'make_html := true; exit_use_dir"Lex";quit();' | $(LOGIC);\
   195 	then echo 'make_html := true; exit_use_dir"Lex";quit();' | $(LOGIC);\
   195 	else echo 'exit_use_dir"Lex";quit();' | $(LOGIC); \
   196 	else echo 'exit_use_dir"Lex";quit();' | $(LOGIC); \
   196 	fi
   197 	fi
   197 
   198 
   198 ##Miscellaneous examples
   199 ##Miscellaneous examples
   201 
   202 
   202 EX_FILES = ex/ROOT.ML ex/cla.ML ex/meson.ML ex/mesontest.ML ex/rel.ML \
   203 EX_FILES = ex/ROOT.ML ex/cla.ML ex/meson.ML ex/mesontest.ML ex/rel.ML \
   203 	   ex/set.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
   204 	   ex/set.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
   204 
   205 
   205 ex:	$(BIN)/HOL  $(EX_FILES)
   206 ex:	$(BIN)/HOL  $(EX_FILES)
   206 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   207 	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   207 	then echo 'make_html := true; exit_use_dir"ex";quit();' | $(LOGIC);\
   208 	then echo 'make_html := true; exit_use_dir"ex";quit();' | $(LOGIC);\
   208 	else echo 'exit_use_dir"ex";quit();' | $(LOGIC); \
   209 	else echo 'exit_use_dir"ex";quit();' | $(LOGIC); \
   209 	fi
   210 	fi
   210 
   211 
   211 #Full test.
   212 #Full test.