src/HOL/Makefile
author clasohm
Fri Apr 19 11:12:05 1996 +0200 (1996-04-19)
changeset 1665 e5737154d9bf
parent 1639 d3484e841d1e
child 1698 bf46e4acc682
permissions -rw-r--r--
added thy_data.ML
     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 Inductive Finite Arith Sexp Univ List RelPow
    26 
    27 FILES = ROOT.ML add_ind_def.ML datatype.ML hologic.ML\
    28 	ind_syntax.ML indrule.ML intr_elim.ML simpdata.ML\
    29 	typedef.ML thy_syntax.ML thy_data.ML ../Pure/section_utils.ML\
    30 	../Provers/hypsubst.ML ../Provers/classical.ML\
    31         ../Provers/simplifier.ML ../Provers/splitter.ML\
    32  	$(NAMES:%=%.thy) $(NAMES:%=%.ML)
    33 
    34 $(BIN)/HOL:   $(BIN)/Pure  $(FILES) 
    35 	if [ -d $${ISABELLEBIN:?}/Pure ];\
    36            	then echo Bad value for ISABELLEBIN: \
    37                 	$(BIN) is the Isabelle source directory; \
    38                 	exit 1; \
    39            	fi;\
    40 	case "$(COMP)" in \
    41 	poly*)	echo 'make_database"$(BIN)/HOL"; quit();'  \
    42 		  | $(COMP) $(BIN)/Pure;\
    43                 if [ "$${MAKE_HTML}" = "true" ]; \
    44                 then echo 'open PolyML; make_html := true; exit_use_dir".";' \
    45                        | $(COMP) $(BIN)/HOL;\
    46 		elif [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    47                 then echo 'open PolyML; make_html := true; exit_use_dir".";                               make_html := false;' | $(COMP) $(BIN)/HOL;\
    48                 else echo 'open PolyML; exit_use_dir".";' \
    49                        | $(COMP) $(BIN)/HOL;\
    50                 fi;;\
    51 	sml*)	if [ "$${MAKE_HTML}" = "true" ]; \
    52                 then echo 'make_html := true; exit_use_dir".";                                            xML"$(BIN)/HOL" banner;' | $(BIN)/Pure;\
    53                 elif [ "$${MAKE_HTML-undefined}" != "undefined" ];\
    54                 then echo 'make_html := true; exit_use_dir".";                                            make_html := false; xML"$(BIN)/HOL" banner;' \
    55                        | $(BIN)/Pure;\
    56                 else echo 'exit_use_dir"."; xML"$(BIN)/HOL" banner;' \
    57                        | $(BIN)/Pure;\
    58                 fi;;\
    59 	*)	echo Bad value for ISABELLECOMP: \
    60                 	$(COMP) is not poly or sml; exit 1;;\
    61 	esac
    62 
    63 $(BIN)/Pure:
    64 	cd ../Pure;  $(MAKE)
    65 
    66 #### Testing of HOL
    67 
    68 #A macro referring to the object-logic (depends on ML compiler)
    69 LOGIC:sh=case $ISABELLECOMP in \
    70 	poly*)	echo "$ISABELLECOMP $ISABELLEBIN/HOL" ;;\
    71 	sml*)	echo "$ISABELLEBIN/HOL" ;;\
    72 	*)	echo "echo Bad value for ISABELLECOMP: \
    73                 	$ISABELLEBIN is not poly or sml; exit 1" ;;\
    74 	esac
    75 
    76 ##IMP-semantics example
    77 IMP_NAMES = Com Denotation Equiv Properties
    78 IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
    79 
    80 IMP:    $(BIN)/HOL  $(IMP_FILES)
    81 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    82         then echo 'make_html := true; exit_use_dir"IMP";quit();' | $(LOGIC); \
    83         else echo 'exit_use_dir"IMP";quit();' | $(LOGIC); \
    84         fi
    85 
    86 ##Hoare logic
    87 Hoare_NAMES = Hoare Arith2 Examples
    88 Hoare_FILES = Hoare/ROOT.ML $(Hoare_NAMES:%=Hoare/%.thy) \
    89               $(Hoare_NAMES:%=Hoare/%.ML)
    90 
    91 Hoare:  $(BIN)/HOL  $(Hoare_FILES)
    92 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
    93         then echo 'make_html := true; exit_use_dir"Hoare";quit();' | $(LOGIC);\
    94         else echo 'exit_use_dir"Hoare";quit();' | $(LOGIC); \
    95         fi
    96 
    97 ##The integers in HOL
    98 INTEG_NAMES = Equiv Integ 
    99 
   100 INTEG_FILES = Integ/ROOT.ML \
   101               $(INTEG_NAMES:%=Integ/%.thy) $(INTEG_NAMES:%=Integ/%.ML)
   102 
   103 Integ:  $(BIN)/HOL  $(INTEG_FILES)
   104 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   105         then echo 'make_html := true; exit_use_dir"Integ";quit();' | $(LOGIC);\
   106         else echo 'exit_use_dir"Integ";quit();' | $(LOGIC); \
   107         fi
   108 
   109 ##I/O Automata
   110 IOA_NTP_NAMES = Abschannel Action Correctness Impl Lemmas Multiset Packet\
   111                 Receiver Sender
   112 IOA_ABP_NAMES = Action Correctness Lemmas
   113 IOA_MT_NAMES = Asig IOA Option Solve
   114 
   115 IOA_FILES = IOA/NTP/ROOT.ML IOA/ABP/ROOT.ML IOA/NTP/Spec.thy\
   116  $(IOA_NTP_NAMES:%=IOA/NTP/%.thy) $(IOA_NTP_NAMES:%=IOA/NTP/%.ML)\
   117  IOA/ABP/Abschannel.thy IOA/ABP/Abschannel_finite.thy IOA/ABP/Env.thy\
   118  IOA/ABP/Impl.thy IOA/ABP/Impl_finite.thy IOA/ABP/Packet.thy\
   119  IOA/ABP/Receiver.thy IOA/ABP/Sender.thy IOA/ABP/Spec.thy\
   120  $(IOA_ABP_NAMES:%=IOA/ABP/%.thy) $(IOA_ABP_NAMES:%=IOA/ABP/%.ML)\
   121  $(IOA_MT_NAMES:%=IOA/meta_theory/%.thy) $(IOA_MT_NAMES:%=IOA/meta_theory/%.ML)
   122 
   123 IOA:    $(BIN)/HOL  $(IOA_FILES)
   124 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   125         then echo 'make_html := true; exit_use_dir"IOA/NTP";quit();' \
   126                | $(LOGIC);\
   127              echo 'make_html := true; exit_use_dir"IOA/ABP";quit();' \
   128                | $(LOGIC);\
   129         else echo 'exit_use_dir"IOA/NTP";quit();' | $(LOGIC); \
   130 	     echo 'exit_use_dir"IOA/ABP";quit();' | $(LOGIC); \
   131         fi
   132 
   133 ##Properties of substitutions
   134 SUBST_NAMES = AList Setplus Subst Unifier UTerm UTLemmas
   135 
   136 SUBST_FILES = Subst/ROOT.ML \
   137               $(SUBST_NAMES:%=Subst/%.thy) $(SUBST_NAMES:%=Subst/%.ML)
   138 
   139 Subst:  $(BIN)/HOL  $(SUBST_FILES)
   140 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   141         then echo 'make_html := true; exit_use_dir"Subst";quit();' | $(LOGIC);\
   142         else echo 'exit_use_dir"Subst";quit();' | $(LOGIC); \
   143         fi
   144 
   145 ##Confluence of Lambda-calculus
   146 LAMBDA_NAMES = Lambda ParRed Commutation Eta
   147 
   148 LAMBDA_FILES = Lambda/ROOT.ML \
   149               $(LAMBDA_NAMES:%=Lambda/%.thy) $(LAMBDA_NAMES:%=Lambda/%.ML)
   150 
   151 Lambda:  $(BIN)/HOL $(LAMBDA_FILES)
   152 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   153         then echo 'make_html := true; exit_use_dir"Lambda";quit();' \
   154                | $(LOGIC);\
   155         else echo 'exit_use_dir"Lambda";quit();' | $(LOGIC); \
   156         fi
   157 
   158 ##Type inference for MiniML
   159 MINIML_NAMES = I Maybe MiniML Type W
   160 
   161 MINIML_FILES = MiniML/ROOT.ML \
   162               $(MINIML_NAMES:%=MiniML/%.thy) $(MINIML_NAMES:%=MiniML/%.ML)
   163 
   164 MiniML: $(BIN)/HOL  $(MINIML_FILES)
   165 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   166         then echo 'make_html := true; exit_use_dir"MiniML";quit();' \
   167                | $(LOGIC);\
   168         else echo 'exit_use_dir"MiniML";quit();' | $(LOGIC); \
   169         fi
   170 
   171 ##Lexical analysis
   172 LEX_FILES = Auto AutoChopper Chopper Prefix
   173 
   174 LEX_FILES = Lex/ROOT.ML \
   175             $(LEX_NAMES:%=Lex/%.thy) $(LEX_NAMES:%=Lex/%.ML)
   176 
   177 Lex:	$(BIN)/HOL  $(LEX_FILES)
   178 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   179         then echo 'make_html := true; exit_use_dir"Lex";quit();' | $(LOGIC);\
   180         else echo 'exit_use_dir"Lex";quit();' | $(LOGIC); \
   181         fi
   182 
   183 ##Miscellaneous examples
   184 EX_NAMES = LexProd MT Acc PropLog Puzzle Mutil Qsort LList Rec Simult Term \
   185 	   String BT Perm Comb
   186 
   187 EX_FILES = ex/ROOT.ML ex/cla.ML ex/meson.ML ex/mesontest.ML ex/rel.ML \
   188            ex/set.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
   189 
   190 ex:     $(BIN)/HOL  $(EX_FILES)
   191 	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
   192         then echo 'make_html := true; exit_use_dir"ex";quit();' | $(LOGIC);\
   193         else echo 'exit_use_dir"ex";quit();' | $(LOGIC); \
   194         fi
   195 
   196 #Full test.
   197 test:   $(BIN)/HOL IMP Hoare Lex Integ Subst Lambda MiniML IOA ex
   198 	echo 'Test examples ran successfully' > test
   199 
   200 .PRECIOUS:  $(BIN)/Pure $(BIN)/HOL