Coccinelle release-1.0.0-rc11
[bpt/coccinelle.git] / ctl / 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
34e49164
C
25#note: if you add a file (a .mli or .ml), dont forget to do a make depend
26
0708f913
C
27-include ../Makefile.config
28
34e49164
C
29TARGET=ctl
30
31SRC=flag_ctl.ml ast_ctl.ml pretty_print_ctl.ml ctl_engine.ml wrapper_ctl.ml
32
33SYSLIBS=str.cma unix.cma
34LIBS=../commons/commons.cma ../globals/globals.cma
35
36INCLUDES=-I ../commons -I ../commons/ocamlextra -I ../globals
37
38
39#The Caml compilers.
b1b2de81 40#for warning: -w A
34e49164
C
41#for profiling: -p -inline 0 with OCAMLOPT
42OCAMLCFLAGS ?= -g -dtypes
43OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
44OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
0708f913 45OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES)
34e49164
C
46OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
47
48
49
50LIB=$(TARGET).cma
51OPTLIB=$(LIB:.cma=.cmxa)
52
53OBJS = $(SRC:.ml=.cmo)
54OPTOBJS = $(SRC:.ml=.cmx)
55
56all: $(LIB)
57all.opt: $(OPTLIB)
58
59$(TARGET).top: $(LIB) test_ctl.cmo
60 $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) test_ctl.cmo
61
62$(LIB): $(OBJS)
63 $(OCAMLC) -a -o $(LIB) $(OBJS)
64
65$(OPTLIB): $(OPTOBJS)
66 $(OCAMLOPT) -a -o $(OPTLIB) $(OPTOBJS)
67
68clean::
69 rm -f $(LIB) $(OPTLIB) $(LIB:.cma=.a) $(TARGET).top
70
71
72.SUFFIXES:
73.SUFFIXES: .ml .mli .cmo .cmi .cmx
74
75.ml.cmo:
76 $(OCAMLC) -c $<
77
78.mli.cmi:
79 $(OCAMLC) -c $<
80
81.ml.cmx:
82 $(OCAMLOPT) -c $<
83
84
85
86
87# clean rule for others files
88clean::
89 rm -f *.cm[iox] *.o *.annot
b1b2de81 90 rm -f *~ .*~ #*#
34e49164 91
b1b2de81 92depend:
34e49164
C
93 $(OCAMLDEP) *.mli *.ml > .depend
94
95distclean::
96 rm -f .depend
97
98.depend:
99 $(OCAMLDEP) *.mli *.ml > .depend
100
101-include .depend