src/HOL/Makefile
author paulson
Thu Apr 04 10:24:38 1996 +0200 (1996-04-04)
changeset 1639 d3484e841d1e
parent 1620 5bddaab64e0a
child 1665 e5737154d9bf
permissions -rw-r--r--
New example Comb: Church-Rosser for combinators, ported from ZF
clasohm@1296
     1
# $Id$
clasohm@923
     2
#########################################################################
clasohm@923
     3
#									#
clasohm@1164
     4
# 			Makefile for Isabelle (HOL)			#
clasohm@923
     5
#									#
clasohm@923
     6
#########################################################################
clasohm@923
     7
clasohm@923
     8
#To make the system, cd to this directory and type  
clasohm@1296
     9
#	make
clasohm@923
    10
#To make the system and test it on standard examples, type  
clasohm@1296
    11
#	make test
clasohm@1296
    12
#To generate HTML files for every theory, set the environment variable
clasohm@1296
    13
#MAKE_HTML or add the parameter "MAKE_HTML=".
clasohm@923
    14
clasohm@923
    15
#Environment variable ISABELLECOMP specifies the compiler.
clasohm@923
    16
#Environment variable ISABELLEBIN specifies the destination directory.
clasohm@923
    17
#For Poly/ML, ISABELLEBIN must begin with a /
clasohm@923
    18
clasohm@923
    19
#Makes pure Isabelle (Pure) if this file is ABSENT -- but not 
clasohm@923
    20
#if it is out of date, since this Makefile does not know its dependencies!
clasohm@923
    21
clasohm@923
    22
BIN = $(ISABELLEBIN)
clasohm@923
    23
COMP = $(ISABELLECOMP)
nipkow@1129
    24
NAMES = HOL Ord Set Fun subset equalities Prod Relation Trancl Sum WF \
nipkow@1513
    25
       mono Lfp Gfp Nat Inductive Finite Arith Sexp Univ List RelPow
clasohm@923
    26
clasohm@923
    27
FILES = ROOT.ML add_ind_def.ML datatype.ML hologic.ML\
clasohm@923
    28
	ind_syntax.ML indrule.ML intr_elim.ML simpdata.ML\
clasohm@1472
    29
	typedef.ML thy_syntax.ML ../Pure/section_utils.ML\
nipkow@944
    30
	../Provers/hypsubst.ML ../Provers/classical.ML\
nipkow@944
    31
        ../Provers/simplifier.ML ../Provers/splitter.ML\
lcp@1044
    32
 	$(NAMES:%=%.thy) $(NAMES:%=%.ML)
clasohm@923
    33
clasohm@1164
    34
$(BIN)/HOL:   $(BIN)/Pure  $(FILES) 
clasohm@923
    35
	if [ -d $${ISABELLEBIN:?}/Pure ];\
clasohm@923
    36
           	then echo Bad value for ISABELLEBIN: \
clasohm@923
    37
                	$(BIN) is the Isabelle source directory; \
clasohm@923
    38
                	exit 1; \
clasohm@923
    39
           	fi;\
clasohm@923
    40
	case "$(COMP)" in \
clasohm@1164
    41
	poly*)	echo 'make_database"$(BIN)/HOL"; quit();'  \
clasohm@1296
    42
		  | $(COMP) $(BIN)/Pure;\
clasohm@1491
    43
                if [ "$${MAKE_HTML}" = "true" ]; \
clasohm@1357
    44
                then echo 'open PolyML; make_html := true; exit_use_dir".";' \
clasohm@1491
    45
                       | $(COMP) $(BIN)/HOL;\
clasohm@1491
    46
		elif [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
clasohm@1491
    47
                then echo 'open PolyML; make_html := true; exit_use_dir".";                               make_html := false;' | $(COMP) $(BIN)/HOL;\
clasohm@1491
    48
                else echo 'open PolyML; exit_use_dir".";' \
clasohm@1357
    49
                       | $(COMP) $(BIN)/HOL;\
clasohm@1296
    50
                fi;;\
clasohm@1491
    51
	sml*)	if [ "$${MAKE_HTML}" = "true" ]; \
clasohm@1367
    52
                then echo 'make_html := true; exit_use_dir".";                                            xML"$(BIN)/HOL" banner;' | $(BIN)/Pure;\
clasohm@1491
    53
                elif [ "$${MAKE_HTML-undefined}" != "undefined" ];\
clasohm@1491
    54
                then echo 'make_html := true; exit_use_dir".";                                            make_html := false; xML"$(BIN)/HOL" banner;' \
clasohm@1491
    55
                       | $(BIN)/Pure;\
clasohm@1357
    56
                else echo 'exit_use_dir"."; xML"$(BIN)/HOL" banner;' \
clasohm@1296
    57
                       | $(BIN)/Pure;\
clasohm@1296
    58
                fi;;\
clasohm@923
    59
	*)	echo Bad value for ISABELLECOMP: \
clasohm@923
    60
                	$(COMP) is not poly or sml; exit 1;;\
clasohm@923
    61
	esac
clasohm@923
    62
clasohm@923
    63
$(BIN)/Pure:
clasohm@923
    64
	cd ../Pure;  $(MAKE)
clasohm@923
    65
clasohm@1164
    66
#### Testing of HOL
clasohm@923
    67
clasohm@923
    68
#A macro referring to the object-logic (depends on ML compiler)
clasohm@923
    69
LOGIC:sh=case $ISABELLECOMP in \
clasohm@1164
    70
	poly*)	echo "$ISABELLECOMP $ISABELLEBIN/HOL" ;;\
clasohm@1164
    71
	sml*)	echo "$ISABELLEBIN/HOL" ;;\
clasohm@923
    72
	*)	echo "echo Bad value for ISABELLECOMP: \
clasohm@923
    73
                	$ISABELLEBIN is not poly or sml; exit 1" ;;\
clasohm@923
    74
	esac
clasohm@923
    75
clasohm@923
    76
##IMP-semantics example
lcp@1044
    77
IMP_NAMES = Com Denotation Equiv Properties
lcp@1044
    78
IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
clasohm@923
    79
clasohm@1164
    80
IMP:    $(BIN)/HOL  $(IMP_FILES)
clasohm@1491
    81
	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
clasohm@1491
    82
        then echo 'make_html := true; exit_use_dir"IMP";quit();' | $(LOGIC); \
clasohm@1491
    83
        else echo 'exit_use_dir"IMP";quit();' | $(LOGIC); \
clasohm@1491
    84
        fi
clasohm@923
    85
nipkow@1336
    86
##Hoare logic
nipkow@1336
    87
Hoare_NAMES = Hoare Arith2 Examples
clasohm@1491
    88
Hoare_FILES = Hoare/ROOT.ML $(Hoare_NAMES:%=Hoare/%.thy) \
clasohm@1491
    89
              $(Hoare_NAMES:%=Hoare/%.ML)
nipkow@1336
    90
nipkow@1336
    91
Hoare:  $(BIN)/HOL  $(Hoare_FILES)
clasohm@1491
    92
	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
clasohm@1491
    93
        then echo 'make_html := true; exit_use_dir"Hoare";quit();' | $(LOGIC);\
clasohm@1491
    94
        else echo 'exit_use_dir"Hoare";quit();' | $(LOGIC); \
clasohm@1491
    95
        fi
nipkow@1336
    96
clasohm@1164
    97
##The integers in HOL
nipkow@1129
    98
INTEG_NAMES = Equiv Integ 
clasohm@923
    99
lcp@1044
   100
INTEG_FILES = Integ/ROOT.ML \
lcp@1044
   101
              $(INTEG_NAMES:%=Integ/%.thy) $(INTEG_NAMES:%=Integ/%.ML)
clasohm@923
   102
clasohm@1164
   103
Integ:  $(BIN)/HOL  $(INTEG_FILES)
clasohm@1491
   104
	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
clasohm@1491
   105
        then echo 'make_html := true; exit_use_dir"Integ";quit();' | $(LOGIC);\
clasohm@1491
   106
        else echo 'exit_use_dir"Integ";quit();' | $(LOGIC); \
clasohm@1491
   107
        fi
clasohm@923
   108
clasohm@923
   109
##I/O Automata
nipkow@1063
   110
IOA_NTP_NAMES = Abschannel Action Correctness Impl Lemmas Multiset Packet\
nipkow@1063
   111
                Receiver Sender
nipkow@1063
   112
IOA_ABP_NAMES = Action Correctness Lemmas
lcp@1044
   113
IOA_MT_NAMES = Asig IOA Option Solve
clasohm@923
   114
clasohm@1350
   115
IOA_FILES = IOA/NTP/ROOT.ML IOA/ABP/ROOT.ML IOA/NTP/Spec.thy\
nipkow@1063
   116
 $(IOA_NTP_NAMES:%=IOA/NTP/%.thy) $(IOA_NTP_NAMES:%=IOA/NTP/%.ML)\
nipkow@1063
   117
 IOA/ABP/Abschannel.thy IOA/ABP/Abschannel_finite.thy IOA/ABP/Env.thy\
nipkow@1063
   118
 IOA/ABP/Impl.thy IOA/ABP/Impl_finite.thy IOA/ABP/Packet.thy\
nipkow@1063
   119
 IOA/ABP/Receiver.thy IOA/ABP/Sender.thy IOA/ABP/Spec.thy\
nipkow@1063
   120
 $(IOA_ABP_NAMES:%=IOA/ABP/%.thy) $(IOA_ABP_NAMES:%=IOA/ABP/%.ML)\
lcp@1044
   121
 $(IOA_MT_NAMES:%=IOA/meta_theory/%.thy) $(IOA_MT_NAMES:%=IOA/meta_theory/%.ML)
clasohm@923
   122
clasohm@1164
   123
IOA:    $(BIN)/HOL  $(IOA_FILES)
clasohm@1491
   124
	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
clasohm@1491
   125
        then echo 'make_html := true; exit_use_dir"IOA/NTP";quit();' \
clasohm@1491
   126
               | $(LOGIC);\
clasohm@1491
   127
             echo 'make_html := true; exit_use_dir"IOA/ABP";quit();' \
clasohm@1491
   128
               | $(LOGIC);\
clasohm@1491
   129
        else echo 'exit_use_dir"IOA/NTP";quit();' | $(LOGIC); \
clasohm@1491
   130
	     echo 'exit_use_dir"IOA/ABP";quit();' | $(LOGIC); \
clasohm@1491
   131
        fi
clasohm@923
   132
clasohm@923
   133
##Properties of substitutions
lcp@1044
   134
SUBST_NAMES = AList Setplus Subst Unifier UTerm UTLemmas
clasohm@923
   135
lcp@1044
   136
SUBST_FILES = Subst/ROOT.ML \
lcp@1044
   137
              $(SUBST_NAMES:%=Subst/%.thy) $(SUBST_NAMES:%=Subst/%.ML)
clasohm@923
   138
clasohm@1164
   139
Subst:  $(BIN)/HOL  $(SUBST_FILES)
clasohm@1491
   140
	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
clasohm@1491
   141
        then echo 'make_html := true; exit_use_dir"Subst";quit();' | $(LOGIC);\
clasohm@1491
   142
        else echo 'exit_use_dir"Subst";quit();' | $(LOGIC); \
clasohm@1491
   143
        fi
clasohm@923
   144
nipkow@1125
   145
##Confluence of Lambda-calculus
nipkow@1270
   146
LAMBDA_NAMES = Lambda ParRed Commutation Eta
nipkow@1125
   147
nipkow@1125
   148
LAMBDA_FILES = Lambda/ROOT.ML \
nipkow@1125
   149
              $(LAMBDA_NAMES:%=Lambda/%.thy) $(LAMBDA_NAMES:%=Lambda/%.ML)
nipkow@1125
   150
clasohm@1350
   151
Lambda:  $(BIN)/HOL $(LAMBDA_FILES)
clasohm@1491
   152
	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
clasohm@1491
   153
        then echo 'make_html := true; exit_use_dir"Lambda";quit();' \
clasohm@1491
   154
               | $(LOGIC);\
clasohm@1491
   155
        else echo 'exit_use_dir"Lambda";quit();' | $(LOGIC); \
clasohm@1491
   156
        fi
nipkow@1125
   157
nipkow@1343
   158
##Type inference for MiniML
nipkow@1301
   159
MINIML_NAMES = I Maybe MiniML Type W
nipkow@1301
   160
nipkow@1343
   161
MINIML_FILES = MiniML/ROOT.ML \
nipkow@1301
   162
              $(MINIML_NAMES:%=MiniML/%.thy) $(MINIML_NAMES:%=MiniML/%.ML)
nipkow@1301
   163
clasohm@1350
   164
MiniML: $(BIN)/HOL  $(MINIML_FILES)
clasohm@1491
   165
	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
clasohm@1491
   166
        then echo 'make_html := true; exit_use_dir"MiniML";quit();' \
clasohm@1491
   167
               | $(LOGIC);\
clasohm@1491
   168
        else echo 'exit_use_dir"MiniML";quit();' | $(LOGIC); \
clasohm@1491
   169
        fi
nipkow@1301
   170
nipkow@1343
   171
##Lexical analysis
nipkow@1343
   172
LEX_FILES = Auto AutoChopper Chopper Prefix
nipkow@1343
   173
nipkow@1343
   174
LEX_FILES = Lex/ROOT.ML \
nipkow@1343
   175
            $(LEX_NAMES:%=Lex/%.thy) $(LEX_NAMES:%=Lex/%.ML)
nipkow@1343
   176
nipkow@1343
   177
Lex:	$(BIN)/HOL  $(LEX_FILES)
clasohm@1491
   178
	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
clasohm@1491
   179
        then echo 'make_html := true; exit_use_dir"Lex";quit();' | $(LOGIC);\
clasohm@1491
   180
        else echo 'exit_use_dir"Lex";quit();' | $(LOGIC); \
clasohm@1491
   181
        fi
nipkow@1343
   182
clasohm@923
   183
##Miscellaneous examples
paulson@1620
   184
EX_NAMES = LexProd MT Acc PropLog Puzzle Mutil Qsort LList Rec Simult Term \
paulson@1639
   185
	   String BT Perm Comb
clasohm@923
   186
clasohm@923
   187
EX_FILES = ex/ROOT.ML ex/cla.ML ex/meson.ML ex/mesontest.ML ex/rel.ML \
lcp@1044
   188
           ex/set.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
clasohm@923
   189
clasohm@1164
   190
ex:     $(BIN)/HOL  $(EX_FILES)
clasohm@1491
   191
	if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
clasohm@1491
   192
        then echo 'make_html := true; exit_use_dir"ex";quit();' | $(LOGIC);\
clasohm@1491
   193
        else echo 'exit_use_dir"ex";quit();' | $(LOGIC); \
clasohm@1491
   194
        fi
clasohm@923
   195
nipkow@1343
   196
#Full test.
nipkow@1343
   197
test:   $(BIN)/HOL IMP Hoare Lex Integ Subst Lambda MiniML IOA ex
clasohm@923
   198
	echo 'Test examples ran successfully' > test
clasohm@923
   199
clasohm@1164
   200
.PRECIOUS:  $(BIN)/Pure $(BIN)/HOL