src/HOL/Makefile
author paulson
Tue Dec 10 15:08:57 1996 +0100 (1996-12-10)
changeset 2371 c5dc6f8b385b
parent 2329 55060cfeda1b
child 2450 3ad2493fa0e0
permissions -rw-r--r--
Now target "test" builds and tests TFL
clasohm@1296
     1
# $Id$
clasohm@923
     2
#########################################################################
clasohm@923
     3
#									#
paulson@2094
     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@2094
    25
	mono Lfp Gfp Nat intr_elim indrule Inductive Finite Arith \
paulson@2094
    26
	Sexp Univ List RelPow Option
clasohm@923
    27
clasohm@923
    28
FILES = ROOT.ML add_ind_def.ML datatype.ML hologic.ML\
paulson@1981
    29
	ind_syntax.ML cladata.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\
paulson@2094
    32
	../Provers/simplifier.ML ../Provers/splitter.ML\
paulson@2094
    33
	$(NAMES:%=%.thy) $(NAMES:%=%.ML)
clasohm@923
    34
clasohm@1164
    35
$(BIN)/HOL:   $(BIN)/Pure  $(FILES) 
paulson@2117
    36
	@if [ -d $${ISABELLEBIN:?}/Pure ];\
paulson@2094
    37
		then echo Bad value for ISABELLEBIN: \
paulson@2094
    38
			$(BIN) is the Isabelle source directory; \
paulson@2094
    39
			exit 1; \
paulson@2117
    40
	fi
paulson@2235
    41
	@case `basename "$(COMP)"` in \
clasohm@1164
    42
	poly*)	echo 'make_database"$(BIN)/HOL"; quit();'  \
clasohm@1296
    43
		  | $(COMP) $(BIN)/Pure;\
paulson@2094
    44
		if [ "$${MAKE_HTML}" = "true" ]; \
paulson@2094
    45
		then echo 'open PolyML; make_html := true; exit_use_dir".";' \
paulson@2094
    46
		       | $(COMP) $(BIN)/HOL;\
clasohm@1491
    47
		elif [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2094
    48
		then echo 'open PolyML; make_html := true; exit_use_dir".";				  make_html := false;' | $(COMP) $(BIN)/HOL;\
paulson@2094
    49
		else echo 'open PolyML; exit_use_dir".";' \
paulson@2094
    50
		       | $(COMP) $(BIN)/HOL;\
paulson@2094
    51
		fi;\
paulson@2023
    52
		discgarb -c $(BIN)/HOL;;\
clasohm@1491
    53
	sml*)	if [ "$${MAKE_HTML}" = "true" ]; \
paulson@2094
    54
		then echo 'make_html := true; exit_use_dir".";						  xML"$(BIN)/HOL" banner;' | $(BIN)/Pure;\
paulson@2094
    55
		elif [ "$${MAKE_HTML-undefined}" != "undefined" ];\
paulson@2094
    56
		then echo 'make_html := true; exit_use_dir".";						  make_html := false; xML"$(BIN)/HOL" banner;' \
paulson@2094
    57
		       | $(BIN)/Pure;\
paulson@2094
    58
		else echo 'exit_use_dir"."; xML"$(BIN)/HOL" banner;' \
paulson@2094
    59
		       | $(BIN)/Pure;\
paulson@2094
    60
		fi;;\
clasohm@923
    61
	*)	echo Bad value for ISABELLECOMP: \
paulson@2117
    62
			\"$(COMP)\" is not poly or sml; exit 1;;\
clasohm@923
    63
	esac
clasohm@923
    64
clasohm@923
    65
$(BIN)/Pure:
clasohm@923
    66
	cd ../Pure;  $(MAKE)
clasohm@923
    67
clasohm@1164
    68
#### Testing of HOL
clasohm@923
    69
clasohm@923
    70
#A macro referring to the object-logic (depends on ML compiler)
paulson@2235
    71
#	[Thanks to Thomas Santen and Stephan Herrmann from GMD First]
paulson@2235
    72
LOGIC=`case \`basename "$(ISABELLECOMP)"\` in \
paulson@2235
    73
	poly*)	echo "$(ISABELLECOMP) $(ISABELLEBIN)/HOL" ;;\
paulson@2235
    74
	sml*)	echo "$(ISABELLEBIN)/HOL" ;;\
paulson@2117
    75
	*)	echo "echo; echo Bad value for ISABELLECOMP: \
paulson@2235
    76
			$(ISABELLECOMP) is not poly or sml; exit 1" ;;\
paulson@2235
    77
	esac`
clasohm@923
    78
paulson@2371
    79
##TFL (requires integration into HOL proper)
paulson@2371
    80
TFL_NAMES = mask tfl thms thry usyntax utils
paulson@2371
    81
TFL_FILES = ../TFL/ROOT.ML ../TFL/sys.sml \
paulson@2371
    82
            $(TFL_NAMES:%=../TFL/%.sig) $(TFL_NAMES:%=../TFL/%.sml)
paulson@2371
    83
paulson@2371
    84
TFL:	$(BIN)/HOL  $(TFL_FILES)
paulson@2371
    85
	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2371
    86
	then echo 'make_html:= true; exit_use_dir"../TFL";quit();' | $(LOGIC);\
paulson@2371
    87
	else echo 'exit_use_dir"../TFL";quit();' | $(LOGIC); \
paulson@2371
    88
	fi
paulson@2371
    89
clasohm@923
    90
##IMP-semantics example
nipkow@1699
    91
IMP_NAMES = Expr Com Natural Transition Denotation Hoare VC
lcp@1044
    92
IMP_FILES = IMP/ROOT.ML $(IMP_NAMES:%=IMP/%.thy) $(IMP_NAMES:%=IMP/%.ML)
clasohm@923
    93
paulson@2094
    94
IMP:	$(BIN)/HOL  $(IMP_FILES)
paulson@2117
    95
	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2094
    96
	then echo 'make_html := true; exit_use_dir"IMP";quit();' | $(LOGIC); \
paulson@2094
    97
	else echo 'exit_use_dir"IMP";quit();' | $(LOGIC); \
paulson@2094
    98
	fi
clasohm@923
    99
nipkow@1336
   100
##Hoare logic
nipkow@1336
   101
Hoare_NAMES = Hoare Arith2 Examples
clasohm@1491
   102
Hoare_FILES = Hoare/ROOT.ML $(Hoare_NAMES:%=Hoare/%.thy) \
paulson@2094
   103
	      $(Hoare_NAMES:%=Hoare/%.ML)
nipkow@1336
   104
paulson@2094
   105
Hoare:	$(BIN)/HOL  $(Hoare_FILES)
paulson@2117
   106
	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2094
   107
	then echo 'make_html := true; exit_use_dir"Hoare";quit();' | $(LOGIC);\
paulson@2094
   108
	else echo 'exit_use_dir"Hoare";quit();' | $(LOGIC); \
paulson@2094
   109
	fi
nipkow@1336
   110
clasohm@1164
   111
##The integers in HOL
nipkow@2279
   112
INTEG_NAMES = Equiv Integ Group Ring Lagrange IntRingDefs IntRing
clasohm@923
   113
lcp@1044
   114
INTEG_FILES = Integ/ROOT.ML \
paulson@2094
   115
	      $(INTEG_NAMES:%=Integ/%.thy) $(INTEG_NAMES:%=Integ/%.ML)
clasohm@923
   116
paulson@2094
   117
Integ:	$(BIN)/HOL  $(INTEG_FILES)
paulson@2117
   118
	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2094
   119
	then echo 'make_html := true; exit_use_dir"Integ";quit();' | $(LOGIC);\
paulson@2094
   120
	else echo 'exit_use_dir"Integ";quit();' | $(LOGIC); \
paulson@2094
   121
	fi
clasohm@923
   122
clasohm@923
   123
##I/O Automata
nipkow@1063
   124
IOA_NTP_NAMES = Abschannel Action Correctness Impl Lemmas Multiset Packet\
paulson@2094
   125
		Receiver Sender
nipkow@1063
   126
IOA_ABP_NAMES = Action Correctness Lemmas
nipkow@2019
   127
IOA_MT_NAMES = Asig IOA Solve
clasohm@923
   128
clasohm@1350
   129
IOA_FILES = IOA/NTP/ROOT.ML IOA/ABP/ROOT.ML IOA/NTP/Spec.thy\
nipkow@1063
   130
 $(IOA_NTP_NAMES:%=IOA/NTP/%.thy) $(IOA_NTP_NAMES:%=IOA/NTP/%.ML)\
nipkow@1063
   131
 IOA/ABP/Abschannel.thy IOA/ABP/Abschannel_finite.thy IOA/ABP/Env.thy\
nipkow@1063
   132
 IOA/ABP/Impl.thy IOA/ABP/Impl_finite.thy IOA/ABP/Packet.thy\
nipkow@1063
   133
 IOA/ABP/Receiver.thy IOA/ABP/Sender.thy IOA/ABP/Spec.thy\
nipkow@1063
   134
 $(IOA_ABP_NAMES:%=IOA/ABP/%.thy) $(IOA_ABP_NAMES:%=IOA/ABP/%.ML)\
lcp@1044
   135
 $(IOA_MT_NAMES:%=IOA/meta_theory/%.thy) $(IOA_MT_NAMES:%=IOA/meta_theory/%.ML)
clasohm@923
   136
paulson@2094
   137
IOA:	$(BIN)/HOL  $(IOA_FILES)
paulson@2117
   138
	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2094
   139
	then echo 'make_html := true; exit_use_dir"IOA/NTP";quit();' \
paulson@2094
   140
	       | $(LOGIC);\
paulson@2094
   141
	     echo 'make_html := true; exit_use_dir"IOA/ABP";quit();' \
paulson@2094
   142
	       | $(LOGIC);\
paulson@2094
   143
	else echo 'exit_use_dir"IOA/NTP";quit();' | $(LOGIC); \
clasohm@1491
   144
	     echo 'exit_use_dir"IOA/ABP";quit();' | $(LOGIC); \
paulson@2094
   145
	fi
clasohm@923
   146
paulson@1972
   147
paulson@1972
   148
##Authentication & Security Protocols
paulson@2117
   149
Auth_NAMES = Message Shared NS_Shared OtwayRees OtwayRees_AN OtwayRees_Bad \
paulson@2329
   150
	     WooLam Yahalom Yahalom2 Public NS_Public_Bad NS_Public
paulson@1972
   151
paulson@1972
   152
AUTH_FILES = Auth/ROOT.ML $(AUTH_NAMES:%=Auth/%.thy) $(AUTH_NAMES:%=Auth/%.ML)
paulson@1972
   153
paulson@2094
   154
Auth:	$(BIN)/HOL  $(AUTH_FILES)
paulson@2117
   155
	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2094
   156
	then echo 'make_html := true; exit_use_dir"Auth";quit();' | $(LOGIC);\
paulson@2094
   157
	else echo 'exit_use_dir"Auth";quit();' | $(LOGIC); \
paulson@2094
   158
	fi
paulson@1972
   159
paulson@1972
   160
clasohm@923
   161
##Properties of substitutions
lcp@1044
   162
SUBST_NAMES = AList Setplus Subst Unifier UTerm UTLemmas
clasohm@923
   163
lcp@1044
   164
SUBST_FILES = Subst/ROOT.ML \
paulson@2094
   165
	      $(SUBST_NAMES:%=Subst/%.thy) $(SUBST_NAMES:%=Subst/%.ML)
clasohm@923
   166
paulson@2094
   167
Subst:	$(BIN)/HOL  $(SUBST_FILES)
paulson@2117
   168
	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2094
   169
	then echo 'make_html := true; exit_use_dir"Subst";quit();' | $(LOGIC);\
paulson@2094
   170
	else echo 'exit_use_dir"Subst";quit();' | $(LOGIC); \
paulson@2094
   171
	fi
clasohm@923
   172
nipkow@1125
   173
##Confluence of Lambda-calculus
nipkow@1270
   174
LAMBDA_NAMES = Lambda ParRed Commutation Eta
nipkow@1125
   175
nipkow@1125
   176
LAMBDA_FILES = Lambda/ROOT.ML \
paulson@2094
   177
	      $(LAMBDA_NAMES:%=Lambda/%.thy) $(LAMBDA_NAMES:%=Lambda/%.ML)
nipkow@1125
   178
paulson@2094
   179
Lambda:	 $(BIN)/HOL $(LAMBDA_FILES)
paulson@2117
   180
	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2094
   181
	then echo 'make_html := true; exit_use_dir"Lambda";quit();' \
paulson@2094
   182
	       | $(LOGIC);\
paulson@2094
   183
	else echo 'exit_use_dir"Lambda";quit();' | $(LOGIC); \
paulson@2094
   184
	fi
nipkow@1125
   185
nipkow@1343
   186
##Type inference for MiniML
nipkow@1301
   187
MINIML_NAMES = I Maybe MiniML Type W
nipkow@1301
   188
nipkow@1343
   189
MINIML_FILES = MiniML/ROOT.ML \
paulson@2094
   190
	      $(MINIML_NAMES:%=MiniML/%.thy) $(MINIML_NAMES:%=MiniML/%.ML)
nipkow@1301
   191
clasohm@1350
   192
MiniML: $(BIN)/HOL  $(MINIML_FILES)
paulson@2117
   193
	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2094
   194
	then echo 'make_html := true; exit_use_dir"MiniML";quit();' \
paulson@2094
   195
	       | $(LOGIC);\
paulson@2094
   196
	else echo 'exit_use_dir"MiniML";quit();' | $(LOGIC); \
paulson@2094
   197
	fi
nipkow@1301
   198
nipkow@1343
   199
##Lexical analysis
nipkow@1343
   200
LEX_FILES = Auto AutoChopper Chopper Prefix
nipkow@1343
   201
nipkow@1343
   202
LEX_FILES = Lex/ROOT.ML \
paulson@2094
   203
	    $(LEX_NAMES:%=Lex/%.thy) $(LEX_NAMES:%=Lex/%.ML)
nipkow@1343
   204
nipkow@1343
   205
Lex:	$(BIN)/HOL  $(LEX_FILES)
paulson@2117
   206
	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2094
   207
	then echo 'make_html := true; exit_use_dir"Lex";quit();' | $(LOGIC);\
paulson@2094
   208
	else echo 'exit_use_dir"Lex";quit();' | $(LOGIC); \
paulson@2094
   209
	fi
nipkow@1343
   210
clasohm@923
   211
##Miscellaneous examples
nipkow@2279
   212
EX_NAMES = String BT Perm Comb InSort Qsort LexProd \
paulson@2235
   213
	   Puzzle Mutil Primes NatSum SList LList Acc PropLog Term Simult MT
clasohm@923
   214
clasohm@923
   215
EX_FILES = ex/ROOT.ML ex/cla.ML ex/meson.ML ex/mesontest.ML ex/rel.ML \
paulson@2094
   216
	   ex/set.ML $(EX_NAMES:%=ex/%.thy) $(EX_NAMES:%=ex/%.ML)
clasohm@923
   217
paulson@2094
   218
ex:	$(BIN)/HOL  $(EX_FILES)
paulson@2117
   219
	@if [ "$${MAKE_HTML-undefined}" != "undefined" ]; \
paulson@2094
   220
	then echo 'make_html := true; exit_use_dir"ex";quit();' | $(LOGIC);\
paulson@2094
   221
	else echo 'exit_use_dir"ex";quit();' | $(LOGIC); \
paulson@2094
   222
	fi
clasohm@923
   223
nipkow@1343
   224
#Full test.
paulson@2371
   225
test:	$(BIN)/HOL TFL IMP Hoare Lex Integ Auth Subst Lambda MiniML IOA ex
clasohm@923
   226
	echo 'Test examples ran successfully' > test
clasohm@923
   227
clasohm@1164
   228
.PRECIOUS:  $(BIN)/Pure $(BIN)/HOL