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