Commit | Line | Data |
---|---|---|
c491d8ee C |
1 | # Copyright 2010, INRIA, University of Copenhagen |
2 | # Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix | |
3 | # Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen | |
4 | # Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix | |
5 | # This file is part of Coccinelle. | |
6 | # | |
7 | # Coccinelle is free software: you can redistribute it and/or modify | |
8 | # it under the terms of the GNU General Public License as published by | |
9 | # the Free Software Foundation, according to version 2 of the License. | |
10 | # | |
11 | # Coccinelle is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with Coccinelle. If not, see <http://www.gnu.org/licenses/>. | |
18 | # | |
19 | # The authors reserve the right to distribute this or future versions of | |
20 | # Coccinelle under other licenses. | |
21 | ||
22 | ||
0708f913 C |
23 | |
24 | -include ../Makefile.config | |
25 | ||
34e49164 C |
26 | ############################################################################## |
27 | # Variables | |
28 | ############################################################################## | |
29 | TARGET=globals | |
30 | ||
3a314143 | 31 | SRC= flag.ml config.ml iteration.ml |
34e49164 | 32 | |
faf9a90c | 33 | LIBS= |
3a314143 | 34 | INCLUDES= -I ../commons |
34e49164 C |
35 | |
36 | ############################################################################## | |
37 | # Generic variables | |
38 | ############################################################################## | |
39 | OCAMLCFLAGS ?= -g -dtypes | |
40 | OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES) | |
41 | OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES) | |
0708f913 | 42 | OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES) |
34e49164 C |
43 | OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES) |
44 | ||
45 | OBJS= $(SRC:.ml=.cmo) | |
46 | OPTOBJS= $(SRC:.ml=.cmx) | |
47 | ||
48 | ||
49 | ############################################################################## | |
50 | # Top rules | |
51 | ############################################################################## | |
52 | all: $(TARGET).cma | |
53 | ||
54 | all.opt: $(TARGET).cmxa | |
55 | ||
34e49164 C |
56 | $(TARGET).cma: $(OBJS) $(LIBS) |
57 | $(OCAMLC) -a -o $(TARGET).cma $(OBJS) | |
58 | ||
59 | $(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa) | |
60 | $(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS) | |
61 | ||
62 | ||
63 | ||
64 | ############################################################################## | |
65 | # Developer rules | |
66 | ############################################################################## | |
67 | .SUFFIXES: .ml .mli .cmo .cmi .cmx | |
68 | ||
69 | .ml.cmo: | |
70 | $(OCAMLC) -c $< | |
71 | .mli.cmi: | |
72 | $(OCAMLC) -c $< | |
73 | .ml.cmx: | |
74 | $(OCAMLOPT) -c $< | |
75 | ||
b1b2de81 | 76 | .ml.mldepend: |
34e49164 C |
77 | $(OCAMLC) -i $< |
78 | ||
79 | clean:: | |
80 | rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot | |
34e49164 C |
81 | rm -f *~ .*~ gmon.out #*# |
82 | ||
b1b2de81 C |
83 | distclean:: |
84 | rm -f .depend | |
85 | ||
34e49164 C |
86 | beforedepend:: |
87 | ||
88 | depend:: beforedepend | |
89 | $(OCAMLDEP) *.mli *.ml > .depend | |
90 | ||
91 | -include .depend | |
92 | ||
93 | ||
94 | ||
95 |