-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (45 loc) · 1.32 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
MENHIR=menhir
MENHIROPTIONS=--dump
OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLDEP=ocamldep
OCAMLLEX=ocamllex
OCAMLYACC=ocamlyacc
OCAMLYACCOPTIONS=-v
INCLUDES= # all relevant -I options here
OCAMLOPTIONS=$(INCLUDES) # add other options for ocamlc here
OCAMLOPTOPTIONS=$(INCLUDES) # add other options for ocamlopt here
PROGNAME=pbci
# The list of object files
COMMONOBJS=support.cmx syntax.cmx gtfparser.cmx gtflexer.cmx typing.cmx eval.cmx pp.cmx
OBJS=$(COMMONOBJS) main.cmx
METAOBJS=$(COMMONOBJS) cogen.cmx metamain.cmx
DEPEND += gtflexer.ml gtfparser.ml
all: $(DEPEND) $(OBJS)
$(OCAMLOPT) -o $(PROGNAME) $(OCAMLOPTIONS) $(OBJS)
meta:
$(MAKE) OCAMLOPT=metaocamlopt OCAMLC=metaocamlc OBJS="$(METAOBJS)" all
# Common rules
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.ml.cmo:
$(OCAMLC) $(OCAMLOPTIONS) -c $<
.mli.cmi:
$(OCAMLC) $(OCAMLOPTIONS) -c $<
.ml.cmx:
$(OCAMLOPT) $(OCAMLOPTOPTIONS) -c $<
gtfparser.ml gtfparser.mli: gtfparser.mly
@rm -f $@
$(MENHIR) $(MENHILOPTIONS) $<
@chmod -w $@
gtflexer.ml: gtflexer.mll
@rm -f $@
$(OCAMLLEX) -o gtflexer.ml $<
@chmod -w $@
# Clean up
clean:
rm -f $(PROGNAME)
rm -f *.cm[iox] *.o *~ gtfparser.ml gtfparser.mli gtfparser.output gtflexer.ml .depend
# Dependencies
depend:: $(DEPEND)
$(OCAMLDEP) $(INCLUDES) -native *.mli $(subst .cmx,.ml,$(COMMONOBJS)) > .depend
-include .depend