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