253b8cfb6efaac9468bf3f378e32e3d27937b5b0
[bpt/coccinelle.git] / ctl / .#Makefile.1.22
1 # Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
2 # Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller
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 TARGET=ctl
24
25 SRC=flag_ctl.ml ast_ctl.ml pretty_print_ctl.ml ctl_engine.ml wrapper_ctl.ml
26
27 SYSLIBS=str.cma unix.cma
28 LIBS=../commons/commons.cma ../globals/globals.cma
29
30 INCLUDES=-I ../commons -I ../commons/ocamlextra -I ../globals
31
32
33 #The Caml compilers.
34 #for warning: -w A
35 #for profiling: -p -inline 0 with OCAMLOPT
36 OCAMLCFLAGS ?= -g -dtypes
37 OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
38 OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
39 OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES)
40 OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
41
42
43
44 LIB=$(TARGET).cma
45 OPTLIB=$(LIB:.cma=.cmxa)
46
47 OBJS = $(SRC:.ml=.cmo)
48 OPTOBJS = $(SRC:.ml=.cmx)
49
50 all: $(LIB)
51 all.opt: $(OPTLIB)
52
53 $(TARGET).top: $(LIB) test_ctl.cmo
54 $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) test_ctl.cmo
55
56 $(LIB): $(OBJS)
57 $(OCAMLC) -a -o $(LIB) $(OBJS)
58
59 $(OPTLIB): $(OPTOBJS)
60 $(OCAMLOPT) -a -o $(OPTLIB) $(OPTOBJS)
61
62 clean::
63 rm -f $(LIB) $(OPTLIB) $(LIB:.cma=.a) $(TARGET).top
64
65
66 .SUFFIXES:
67 .SUFFIXES: .ml .mli .cmo .cmi .cmx
68
69 .ml.cmo:
70 $(OCAMLC) -c $<
71
72 .mli.cmi:
73 $(OCAMLC) -c $<
74
75 .ml.cmx:
76 $(OCAMLOPT) -c $<
77
78
79
80
81 # clean rule for others files
82 clean::
83 rm -f *.cm[iox] *.o *.annot
84 rm -f *~ .*~ #*#
85
86 depend:
87 $(OCAMLDEP) *.mli *.ml > .depend
88
89 distclean::
90 rm -f .depend
91
92 .depend:
93 $(OCAMLDEP) *.mli *.ml > .depend
94
95 -include .depend