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