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