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