src/HOL/Makefile
author paulson
Mon Jul 15 14:58:28 1996 +0200 (1996-07-15)
changeset 1862 74d4ae2f6fc3
parent 1797 334308d2afbc
child 1972 cc65911dceef
permissions -rw-r--r--
New dummy .thy files to document dependencies
     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
    27 
    28 FILES = ROOT.ML add_ind_def.ML datatype.ML hologic.ML\
    29 	ind_syntax.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 "$(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 	sml*)	if [ "$${MAKE_HTML}" = "true" ]; \
    53                 then echo 'make_html := true; exit_use_dir".";                                            xML"$(BIN)/HOL" banner;' | $(BIN)/Pure;\
    54                 elif [ "$${MAKE_HTML-undefined}" != "undefined" ];\
    55                 then echo 'make_html := true; exit_use_dir".";                                            make_html := false; xML"$(BIN)/HOL" banner;' \
    56                        | $(BIN)/Pure;\
    57                 else echo 'exit_use_dir"."; xML"$(BIN)/HOL" banner;' \
    58                        | $(BIN)/Pure;\
    59                 fi;;\
    60 	*)	echo Bad value for ISABELLECOMP: \
    61                 	$(COMP) is not poly or sml; exit 1;;\
    62 	esac
    63 
    64 $(BIN)/Pure:
    65 	cd ../Pure;  $(MAKE)
    66 
    67 #### Testing of HOL
    68 
    69 #A macro referring to the object-logic (depends on ML compiler)
    70 LOGIC:sh=case $ISABELLECOMP in \
    71 	poly*)	echo "$ISABELLECOMP $ISABELLEBIN/HOL" ;;\
    72 	sml*)	echo "$ISABELLEBIN/HOL" ;;\
    73 	*)	echo "echo Bad value for ISABELLECOMP: \
    74                 	$ISABELLEBIN is not poly or sml; exit 1" ;;\
    75 	esac
    76 
    77 ##IMP-semantics example
    78 IMP_NAMES = Expr Com Natural Transition Denotation Hoare VC
    79 IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
    80 
    81 IMP:    $(BIN)/HOL  $(IMP_FILES)
    82 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    83         then echo 'make_html := true; exit_use_dir"IMP";quit();' | $(LOGIC); \
    84         else echo 'exit_use_dir"IMP";quit();' | $(LOGIC); \
    85         fi
    86 
    87 ##Hoare logic
    88 Hoare_NAMES = Hoare Arith2 Examples
    89 Hoare_FILES = Hoare/ROOT.ML $(Hoare_NAMES:%=Hoare/%.thy) \
    90               $(Hoare_NAMES:%=Hoare/%.ML)
    91 
    92 Hoare:  $(BIN)/HOL  $(Hoare_FILES)
    93 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    94         then echo 'make_html := true; exit_use_dir"Hoare";quit();' | $(LOGIC);\
    95         else echo 'exit_use_dir"Hoare";quit();' | $(LOGIC); \
    96         fi
    97 
    98 ##The integers in HOL
    99 INTEG_NAMES = Equiv Integ 
   100 
   101 INTEG_FILES = Integ/ROOT.ML \
   102               $(INTEG_NAMES:%=Integ/%.thy) $(INTEG_NAMES:%=Integ/%.ML)
   103 
   104 Integ:  $(BIN)/HOL  $(INTEG_FILES)
   105 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   106         then echo 'make_html := true; exit_use_dir"Integ";quit();' | $(LOGIC);\
   107         else echo 'exit_use_dir"Integ";quit();' | $(LOGIC); \
   108         fi
   109 
   110 ##I/O Automata
   111 IOA_NTP_NAMES = Abschannel Action Correctness Impl Lemmas Multiset Packet\
   112                 Receiver Sender
   113 IOA_ABP_NAMES = Action Correctness Lemmas
   114 IOA_MT_NAMES = Asig IOA Option Solve
   115 
   116 IOA_FILES = IOA/NTP/ROOT.ML IOA/ABP/ROOT.ML IOA/NTP/Spec.thy\
   117  $(IOA_NTP_NAMES:%=IOA/NTP/%.thy) $(IOA_NTP_NAMES:%=IOA/NTP/%.ML)\
   118  IOA/ABP/Abschannel.thy IOA/ABP/Abschannel_finite.thy IOA/ABP/Env.thy\
   119  IOA/ABP/Impl.thy IOA/ABP/Impl_finite.thy IOA/ABP/Packet.thy\
   120  IOA/ABP/Receiver.thy IOA/ABP/Sender.thy IOA/ABP/Spec.thy\
   121  $(IOA_ABP_NAMES:%=IOA/ABP/%.thy) $(IOA_ABP_NAMES:%=IOA/ABP/%.ML)\
   122  $(IOA_MT_NAMES:%=IOA/meta_theory/%.thy) $(IOA_MT_NAMES:%=IOA/meta_theory/%.ML)
   123 
   124 IOA:    $(BIN)/HOL  $(IOA_FILES)
   125 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   126         then echo 'make_html := true; exit_use_dir"IOA/NTP";quit();' \
   127                | $(LOGIC);\
   128              echo 'make_html := true; exit_use_dir"IOA/ABP";quit();' \
   129                | $(LOGIC);\
   130         else echo 'exit_use_dir"IOA/NTP";quit();' | $(LOGIC); \
   131 	     echo 'exit_use_dir"IOA/ABP";quit();' | $(LOGIC); \
   132         fi
   133 
   134 ##Properties of substitutions
   135 SUBST_NAMES = AList Setplus Subst Unifier UTerm UTLemmas
   136 
   137 SUBST_FILES = Subst/ROOT.ML \
   138               $(SUBST_NAMES:%=Subst/%.thy) $(SUBST_NAMES:%=Subst/%.ML)
   139 
   140 Subst:  $(BIN)/HOL  $(SUBST_FILES)
   141 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   142         then echo 'make_html := true; exit_use_dir"Subst";quit();' | $(LOGIC);\
   143         else echo 'exit_use_dir"Subst";quit();' | $(LOGIC); \
   144         fi
   145 
   146 ##Confluence of Lambda-calculus
   147 LAMBDA_NAMES = Lambda ParRed Commutation Eta
   148 
   149 LAMBDA_FILES = Lambda/ROOT.ML \
   150               $(LAMBDA_NAMES:%=Lambda/%.thy) $(LAMBDA_NAMES:%=Lambda/%.ML)
   151 
   152 Lambda:  $(BIN)/HOL $(LAMBDA_FILES)
   153 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   154         then echo 'make_html := true; exit_use_dir"Lambda";quit();' \
   155                | $(LOGIC);\
   156         else echo 'exit_use_dir"Lambda";quit();' | $(LOGIC); \
   157         fi
   158 
   159 ##Type inference for MiniML
   160 MINIML_NAMES = I Maybe MiniML Type W
   161 
   162 MINIML_FILES = MiniML/ROOT.ML \
   163               $(MINIML_NAMES:%=MiniML/%.thy) $(MINIML_NAMES:%=MiniML/%.ML)
   164 
   165 MiniML: $(BIN)/HOL  $(MINIML_FILES)
   166 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   167         then echo 'make_html := true; exit_use_dir"MiniML";quit();' \
   168                | $(LOGIC);\
   169         else echo 'exit_use_dir"MiniML";quit();' | $(LOGIC); \
   170         fi
   171 
   172 ##Lexical analysis
   173 LEX_FILES = Auto AutoChopper Chopper Prefix
   174 
   175 LEX_FILES = Lex/ROOT.ML \
   176             $(LEX_NAMES:%=Lex/%.thy) $(LEX_NAMES:%=Lex/%.ML)
   177 
   178 Lex:	$(BIN)/HOL  $(LEX_FILES)
   179 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   180         then echo 'make_html := true; exit_use_dir"Lex";quit();' | $(LOGIC);\
   181         else echo 'exit_use_dir"Lex";quit();' | $(LOGIC); \
   182         fi
   183 
   184 ##Miscellaneous examples
   185 EX_NAMES = String BT Perm Comb InSort Qsort LexProd Puzzle Mutil \
   186             Primes NatSum SList LList Acc PropLog Term Simult MT	    
   187 
   188 EX_FILES = ex/ROOT.ML ex/cla.ML ex/meson.ML ex/mesontest.ML ex/rel.ML \
   189            ex/set.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
   190 
   191 ex:     $(BIN)/HOL  $(EX_FILES)
   192 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   193         then echo 'make_html := true; exit_use_dir"ex";quit();' | $(LOGIC);\
   194         else echo 'exit_use_dir"ex";quit();' | $(LOGIC); \
   195         fi
   196 
   197 #Full test.
   198 test:   $(BIN)/HOL IMP Hoare Lex Integ Subst Lambda MiniML IOA ex
   199 	echo 'Test examples ran successfully' > test
   200 
   201 .PRECIOUS:  $(BIN)/Pure $(BIN)/HOL