-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
83 lines (61 loc) · 2.64 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
76
77
78
79
80
81
82
83
#**************************************************************************
#* *
#* OCaml *
#* *
#* Xavier Leroy, projet Cristal, INRIA Rocquencourt *
#* *
#* Copyright 1999 Institut National de Recherche en Informatique et *
#* en Automatique. *
#* *
#* All rights reserved. This file is distributed under the terms of *
#* the GNU Lesser General Public License version 2.1, with the *
#* special exception on linking described in the file LICENSE. *
#* *
#**************************************************************************
# The lexer generator
ROOTDIR = ..
# NOTE: it is important that OCAMLLEX is defined *before* Makefile.common
# gets included, so that its definition here takes precedence
# over the one there.
OCAMLLEX ?= $(BOOT_OCAMLLEX)
include $(ROOTDIR)/Makefile.common
OCAMLYACCFLAGS = -v
CAMLC = $(BOOT_OCAMLC) -strict-sequence -nostdlib \
-I $(ROOTDIR)/boot -use-prims $(ROOTDIR)/runtime/primitives
CAMLOPT = $(OCAMLRUN) $(ROOTDIR)/ocamlopt$(EXE) -nostdlib -I $(ROOTDIR)/stdlib
COMPFLAGS = -absname -w +a-4-9-41-42-44-45-48-70 -warn-error +A \
-safe-string -strict-sequence -strict-formats -bin-annot
LINKFLAGS =
CAMLDEP = $(BOOT_OCAMLC) -depend
DEPFLAGS = -slash
DEPINCLUDES =
OBJS=cset.cmo syntax.cmo parser.cmo lexer.cmo table.cmo lexgen.cmo \
compact.cmo common.cmo output.cmo outputbis.cmo main.cmo
programs := ocamllex ocamllex.opt
$(foreach program, $(programs), $(eval $(call PROGRAM_SYNONYM,$(program))))
.PHONY: all allopt opt.opt # allopt and opt.opt are synonyms
all: ocamllex
allopt: ocamllex.opt
opt.opt: allopt
ocamllex$(EXE): $(OBJS)
$(CAMLC) $(LINKFLAGS) -compat-32 -o $@ $^
ocamllex.opt$(EXE): $(OBJS:.cmo=.cmx)
$(CAMLOPT_CMD) -o $@ $^
clean::
rm -f $(programs) $(programs:=.exe)
rm -f *.cmo *.cmi *.cmx *.cmt *.cmti *.o *.obj
clean::
rm -f parser.ml parser.mli parser.output
beforedepend:: parser.ml parser.mli
clean::
rm -f lexer.ml
beforedepend:: lexer.ml
%.cmo: %.ml
$(CAMLC) -c $(COMPFLAGS) $<
%.cmi: %.mli
$(CAMLC) -c $(COMPFLAGS) $<
%.cmx: %.ml
$(CAMLOPT) -c $(COMPFLAGS) $<
depend: beforedepend
$(CAMLDEP) $(DEPFLAGS) $(DEPINCLUDES) *.mli *.ml > .depend
include .depend