src/HOL/Makefile
author clasohm
Fri Nov 24 11:46:23 1995 +0100 (1995-11-24)
changeset 1367 78bdb2d04771
parent 1357 dac9989eb88f
child 1472 a89803e3d1bd
permissions -rw-r--r--
fixed make_html bug
     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 
    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 	subtype.ML thy_syntax.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-undefined}" != "undefined" ]; \
    44                 then echo 'open PolyML; make_html := true; exit_use_dir".";' \
    45                   | $(COMP) $(BIN)/HOL;\
    46 		else echo 'open PolyML; exit_use_dir".";' \
    47                        | $(COMP) $(BIN)/HOL;\
    48                 fi;;\
    49 	sml*)	if [ "$${MAKE_HTML-undefined}" != "undefined" ];\
    50                 then echo 'make_html := true; exit_use_dir".";                                            xML"$(BIN)/HOL" banner;' | $(BIN)/Pure;\
    51                 else echo 'exit_use_dir"."; xML"$(BIN)/HOL" banner;' \
    52                        | $(BIN)/Pure;\
    53                 fi;;\
    54 	*)	echo Bad value for ISABELLECOMP: \
    55                 	$(COMP) is not poly or sml; exit 1;;\
    56 	esac
    57 
    58 $(BIN)/Pure:
    59 	cd ../Pure;  $(MAKE)
    60 
    61 #### Testing of HOL
    62 
    63 #A macro referring to the object-logic (depends on ML compiler)
    64 LOGIC:sh=case $ISABELLECOMP in \
    65 	poly*)	echo "$ISABELLECOMP $ISABELLEBIN/HOL" ;;\
    66 	sml*)	echo "$ISABELLEBIN/HOL" ;;\
    67 	*)	echo "echo Bad value for ISABELLECOMP: \
    68                 	$ISABELLEBIN is not poly or sml; exit 1" ;;\
    69 	esac
    70 
    71 ##IMP-semantics example
    72 IMP_NAMES = Com Denotation Equiv Properties
    73 IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
    74 
    75 IMP:    $(BIN)/HOL  $(IMP_FILES)
    76 	echo 'exit_use_dir"IMP";quit();' | $(LOGIC)
    77 
    78 ##Hoare logic
    79 Hoare_NAMES = Hoare Arith2 Examples
    80 Hoare_FILES = Hoare/ROOT.ML $(Hoare_NAMES:%=Hoare/%.thy) $(Hoare_NAMES:%=Hoare/%.ML)
    81 
    82 Hoare:  $(BIN)/HOL  $(Hoare_FILES)
    83 	echo 'exit_use_dir"Hoare";quit();' | $(LOGIC)
    84 
    85 ##The integers in HOL
    86 INTEG_NAMES = Equiv Integ 
    87 
    88 INTEG_FILES = Integ/ROOT.ML \
    89               $(INTEG_NAMES:%=Integ/%.thy) $(INTEG_NAMES:%=Integ/%.ML)
    90 
    91 Integ:  $(BIN)/HOL  $(INTEG_FILES)
    92 	echo 'exit_use_dir"Integ";quit();' | $(LOGIC)
    93 
    94 ##I/O Automata
    95 IOA_NTP_NAMES = Abschannel Action Correctness Impl Lemmas Multiset Packet\
    96                 Receiver Sender
    97 IOA_ABP_NAMES = Action Correctness Lemmas
    98 IOA_MT_NAMES = Asig IOA Option Solve
    99 
   100 IOA_FILES = IOA/NTP/ROOT.ML IOA/ABP/ROOT.ML IOA/NTP/Spec.thy\
   101  $(IOA_NTP_NAMES:%=IOA/NTP/%.thy) $(IOA_NTP_NAMES:%=IOA/NTP/%.ML)\
   102  IOA/ABP/Abschannel.thy IOA/ABP/Abschannel_finite.thy IOA/ABP/Env.thy\
   103  IOA/ABP/Impl.thy IOA/ABP/Impl_finite.thy IOA/ABP/Packet.thy\
   104  IOA/ABP/Receiver.thy IOA/ABP/Sender.thy IOA/ABP/Spec.thy\
   105  $(IOA_ABP_NAMES:%=IOA/ABP/%.thy) $(IOA_ABP_NAMES:%=IOA/ABP/%.ML)\
   106  $(IOA_MT_NAMES:%=IOA/meta_theory/%.thy) $(IOA_MT_NAMES:%=IOA/meta_theory/%.ML)
   107 
   108 IOA:    $(BIN)/HOL  $(IOA_FILES)
   109 	echo 'exit_use_dir"IOA/NTP";quit();' | $(LOGIC)
   110 	echo 'exit_use_dir"IOA/ABP";quit();' | $(LOGIC)
   111 
   112 ##Properties of substitutions
   113 SUBST_NAMES = AList Setplus Subst Unifier UTerm UTLemmas
   114 
   115 SUBST_FILES = Subst/ROOT.ML \
   116               $(SUBST_NAMES:%=Subst/%.thy) $(SUBST_NAMES:%=Subst/%.ML)
   117 
   118 Subst:  $(BIN)/HOL  $(SUBST_FILES)
   119 	echo 'exit_use_dir"Subst";quit();' | $(LOGIC)
   120 
   121 ##Confluence of Lambda-calculus
   122 LAMBDA_NAMES = Lambda ParRed Commutation Eta
   123 
   124 LAMBDA_FILES = Lambda/ROOT.ML \
   125               $(LAMBDA_NAMES:%=Lambda/%.thy) $(LAMBDA_NAMES:%=Lambda/%.ML)
   126 
   127 Lambda:  $(BIN)/HOL $(LAMBDA_FILES)
   128 	echo 'exit_use_dir"Lambda";quit();' | $(LOGIC)
   129 
   130 ##Type inference for MiniML
   131 MINIML_NAMES = I Maybe MiniML Type W
   132 
   133 MINIML_FILES = MiniML/ROOT.ML \
   134               $(MINIML_NAMES:%=MiniML/%.thy) $(MINIML_NAMES:%=MiniML/%.ML)
   135 
   136 MiniML: $(BIN)/HOL  $(MINIML_FILES)
   137 	echo 'exit_use_dir"MiniML";quit();' | $(LOGIC)
   138 
   139 ##Lexical analysis
   140 LEX_FILES = Auto AutoChopper Chopper Prefix
   141 
   142 LEX_FILES = Lex/ROOT.ML \
   143             $(LEX_NAMES:%=Lex/%.thy) $(LEX_NAMES:%=Lex/%.ML)
   144 
   145 Lex:	$(BIN)/HOL  $(LEX_FILES)
   146 	echo 'exit_use_dir"Lex";quit();' | $(LOGIC)
   147 
   148 ##Miscellaneous examples
   149 EX_NAMES = LexProd MT Acc PropLog Puzzle Qsort LList Rec Simult Term String \
   150 	   BT Perm
   151 
   152 EX_FILES = ex/ROOT.ML ex/cla.ML ex/meson.ML ex/mesontest.ML ex/rel.ML \
   153            ex/set.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
   154 
   155 ex:     $(BIN)/HOL  $(EX_FILES)
   156 	echo 'exit_use_dir"ex";quit();' | $(LOGIC)
   157 
   158 #Full test.
   159 test:   $(BIN)/HOL IMP Hoare Lex Integ Subst Lambda MiniML IOA ex
   160 	echo 'Test examples ran successfully' > test
   161 
   162 .PRECIOUS:  $(BIN)/Pure $(BIN)/HOL