-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
75 lines (56 loc) · 4.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# List of ML files to compile as a library. This leaves out the following
# which are probably not much use:
#
# sigma.ml (Sigma-formulas and evaluator-by-proof)
# turing.ml (OCaml implementation of Turing machines)
# undecidable.ml (Proofs related to undecidability results)
# bhk.ml (Trivial instance of BHK interpretation)
# many.ml (Example relevant to many-sorted logic)
# hol.ml (Simple higher order logic setup)
# Use camlp5 for versions of OCaml >= 3.10
# Download this from http://pauillac.inria.fr/~ddr/camlp5/
USE_CAMLP5=test `ocamlc -version | cut -c3` != "0" -o `ocamlc -version | cut -c1` == 4
MLFILES = initialization.ml lib.ml intro.ml formulas.ml prop.ml propexamples.ml \
defcnf.ml dp.ml stal.ml bdd.ml fol.ml skolem.ml \
herbrand.ml unif.ml tableaux.ml resolution.ml prolog.ml \
meson.ml skolems.ml equal.ml cong.ml rewrite.ml \
order.ml completion.ml eqelim.ml \
paramodulation.ml decidable.ml qelim.ml cooper.ml \
complex.ml real.ml grobner.ml geom.ml interpolation.ml \
combining.ml lcf.ml lcfprop.ml folderived.ml lcffol.ml \
tactics.ml limitations.ml
# The default is an interactive session skipping the examples.
interactive: atp_interactive.ml init.ml; echo '#use "init.ml";;' >.ocamlinit; (sleep 3s; rm -f .ocamlinit) & ocaml
# Build a bytecode executable
bytecode: example.ml atp_batch.cmo; \
if ${USE_CAMLP5}; \
then ocamlc -pp "camlp5o ./Quotexpander.cmo" -o example nums.cma atp_batch.cmo example.ml; \
else ocamlc -pp "camlp4o ./Quotexpander.cmo" -o example nums.cma atp_batch.cmo example.ml; \
fi
# Alternatively, produce native code
compiled: example.ml atp_batch.cmx; \
if ${USE_CAMLP5}; \
then ocamlopt -pp "camlp5o ./Quotexpander.cmo" -o example nums.cmxa atp_batch.cmx example.ml; \
else ocamlopt -pp "camlp4o ./Quotexpander.cmo" -o example nums.cmxa atp_batch.cmx example.ml; \
fi
# Make the appropriate object for the main body of code
atp_batch.cmx: Quotexpander.cmo atp_batch.ml; \
if ${USE_CAMLP5}; \
then ocamlopt -pp "camlp5o ./Quotexpander.cmo" -w ax -c atp_batch.ml; \
else ocamlopt -pp "camlp4o ./Quotexpander.cmo" -w ax -c atp_batch.ml; \
fi
atp_batch.cmo: Quotexpander.cmo atp_batch.ml; \
if ${USE_CAMLP5}; \
then ocamlc -pp "camlp5o ./Quotexpander.cmo" -w ax -c atp_batch.ml; \
else ocamlc -pp "camlp4o ./Quotexpander.cmo" -w ax -c atp_batch.ml; \
fi
# Make the camlp4 or camlp5 quotation expander
Quotexpander.cmo: Quotexpander.ml; if ${USE_CAMLP5}; \
then ocamlc -I +camlp5 -c Quotexpander.ml; \
else ocamlc -I +camlp4 -c Quotexpander.ml; \
fi
# Extract the non-interactive part of the code
atp_interactive.ml: $(MLFILES); ./Mk_ml_file $(MLFILES) >atp_interactive.ml
atp_batch.ml: $(MLFILES); ./Mk_ml_file $(MLFILES) | grep -v install_printer >atp_batch.ml
# Clean up
clean:; -rm -f atp_batch.cma atp_batch.cmi atp_batch.cmo atp_batch.cmx atp_batch.o atp_batch.ml example example.exe example.cmi example.cmo example.cmx example.o Quotexpander.cmo Quotexpander.cmi atp_interactive.ml .ocamlinit