-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·68 lines (47 loc) · 1.17 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
CAMLC=ocamlc
CAMLOPT=ocamlopt -p
CAMLLEX=ocamllex
CAMLDEP=ocamldep
CAMLDOC=ocamldoc
COMPFLAGS= -warn-error A -dtypes -g
CAMLYACC=ocamlyacc
YACCFLAGS=-v
DOCFLAGS=-html -d camldoc
COMPOBJS=location.cmo spec.cmo math.cmo util.cmo \
parser.cmo lexer.cmo \
options.cmo \
grouping.cmo graphgen.cmo \
mince.cmo
OPTOBJS=$(COMPOBJS:.cmo=.cmx)
SOURCES=$(COMPOBJS:.cmo=.ml)
all: compilo
# cp preludec "$(HOME)/bin"
opt: compiloopt
# cp preludec.opt "$(HOME)/bin"
doc: compilo
$(CAMLDOC) $(DOCFLAGS) $(SOURCES)
# The compiler
compilo: $(COMPOBJS)
$(CAMLC) -o mince -g nums.cma $(COMPOBJS)
compiloopt: $(OPTOBJS)
$(CAMLOPT) -o mince.opt nums.cmxa $(OPTOBJS)
# The parser
parser.mli parser.ml: parser.mly
$(CAMLYACC) $(YACCFLAGS) parser.mly
lexer.ml: lexer.mll
$(CAMLLEX) lexer.mll
# Default rules
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.ml.cmo:
$(CAMLC) $(COMPFLAGS) -c $<
.mli.cmi:
$(CAMLC) $(COMPFLAGS) -c $<
.ml.cmx:
$(CAMLOPT) -c $<
# Misc
clean:
rm -f *.cm[iox] *.[so] *~ *.annot .depend
rm -f parser.ml parser.mli lexer.ml parser.output mince mince.opt
.depend: parser.mli parser.ml lexer.ml $(SOURCES)
$(CAMLDEP) $(DEPFLAGS) *.mli *.ml > .depend
-include .depend