Release coccinelle-0.1.8
[bpt/coccinelle.git] / menhirlib / Makefile
CommitLineData
0708f913
C
1
2-include ../Makefile.config
3
34e49164
C
4##############################################################################
5# Variables
6##############################################################################
7TARGET=menhirLib
8
9SRC= infiniteArray.ml packedIntArray.ml rowDisplacement.ml engineTypes.ml \
10 engine.ml tableFormat.ml tableInterpreter.ml convert.ml
11
12LIBS=
b1b2de81 13INCLUDES=
34e49164
C
14
15# copy what the menhir authors do
16EXTRAOPT=-for-pack MenhirLib
17
18##############################################################################
19# Generic variables
20##############################################################################
708f4980 21OCAMLCFLAGS ?=-g -dtypes
34e49164
C
22OPTFLAGS=
23
b1b2de81
C
24OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
25OCAMLOPT= ocamlopt$(OPTBIN) $(OPTFLAGS) $(EXTRAOPT) $(INCLUDES)
26OCAMLOPT2=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
34e49164
C
27OCAMLLEX=ocamllex$(OPTBIN)
28OCAMLYACC=ocamlyacc -v
0708f913 29OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDES)
34e49164
C
30OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
31
32OBJS= $(SRC:.ml=.cmo)
33OPTOBJS= $(SRC:.ml=.cmx)
34
35
36##############################################################################
37# Top rules
38##############################################################################
39all: $(TARGET).cma menhirLib.cmo
40all.opt: $(TARGET).cmxa menhirLib.cmx
41opt: all.opt
42
43$(TARGET).cma: $(OBJS) $(LIBS)
44 $(OCAMLC) -a -o $@ $(OBJS)
45
46$(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
47 $(OCAMLOPT) -a -o $@ $(OPTOBJS)
48
b1b2de81 49# I thought at first that only one file menhirLib.ml
34e49164 50# was needed but in fact it's a wierd cos menhirLib.cmo results from multi
b1b2de81 51# files. They used the -pack ocamlc option, and for strange reason
34e49164
C
52# decided to produce a .cma instead of a classical .cma.
53# So I put all the necesseray files in this directory.
54
55# copy what the menhir authors do in their own makefile
56menhirLib.cmo: $(OBJS)
57 $(OCAMLC) -pack -o menhirLib.cmo $^
58
59menhirLib.cmx: $(OPTOBJS)
60 $(OCAMLOPT2) -pack -o menhirLib.cmx $^
61
62##############################################################################
63# Generic rules
64##############################################################################
65.SUFFIXES: .ml .mli .cmo .cmi .cmx
66
67.ml.cmo:
68 $(OCAMLC) -c $<
69.mli.cmi:
70 $(OCAMLC) -c $<
71.ml.cmx:
72 $(OCAMLOPT) -c $<
73
b1b2de81 74.ml.mldepend:
34e49164
C
75 $(OCAMLC) -i $<
76
77clean::
78 rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
79
80clean::
81 rm -f *~ .*~ gmon.out #*#
82
83beforedepend::
84
85depend:: beforedepend
86 $(OCAMLDEP) *.mli *.ml > .depend
87
b1b2de81
C
88distclean::
89 rm -f .depend
90
34e49164 91-include .depend