Release coccinelle-0.2.0
[bpt/coccinelle.git] / popl / Makefile
CommitLineData
9f8e26f4
C
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
951c7801
C
21#note: if you add a file (a .mli or .ml), dont forget to do a make depend
22
23-include ../Makefile.config
24
25TARGET = popl
26
27SRC = ast_popl.ml asttopopl.ml insert_quantifiers.ml insert_befaft.ml \
28pretty_print_popl.ml popltoctl.ml popl.ml flag_popl.ml
29
30SYSLIBS=str.cma unix.cma
31LIBS=../commons/commons.cma ../globals/globals.cma
32
33INCLUDE_PATH = -I ../commons -I ../globals \
34 -I ../ctl -I ../parsing_c -I ../parsing_cocci -I ../engine
35
36#The Caml compilers.
37#for warning: -w A
38#for profiling: -p -inline 0 with OCAMLOPT
39CAMLC =ocamlc$(OPTBIN) -dtypes -g
40CAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS)
41CAMLLEX = ocamllex$(OPTBIN)
42CAMLYACC= ocamlyacc
43CAMLDEP = ocamldep$(OPTBIN)
44CAMLMKTOP=ocamlmktop -g -custom
45
46
47
48LIB=$(TARGET).cma
49OPTLIB=$(LIB:.cma=.cmxa)
50
51OBJS = $(SRC:.ml=.cmo)
52OPTOBJS = $(SRC:.ml=.cmx)
53
54all: $(LIB)
55all.opt: $(OPTLIB)
56
57$(TARGET).top: $(LIB)
58 $(CAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
59
60$(LIB): $(OBJS)
61 $(CAMLC) -a -o $(LIB) $(OBJS)
62
63clean::
64 rm -f $(LIB) $(TARGET).top
65
66
67$(OPTLIB): $(OPTOBJS)
68 $(CAMLOPT) -a -o $(OPTLIB) $(OPTOBJS)
69
70# clean rule for LIB.opt
71clean::
72 rm -f $(OPTLIB) $(LIB:.cma=.a)
73
74
75.SUFFIXES:
76.SUFFIXES: .ml .mli .cmo .cmi .cmx
77
78.ml.cmo:
79 $(CAMLC) $(INCLUDE_PATH) -c $<
80
81.mli.cmi:
82 $(CAMLC) $(INCLUDE_PATH) -c $<
83
84.ml.cmx:
85 $(CAMLOPT) $(INCLUDE_PATH) -c $<
86
87
88
89
90# clean rule for others files
91clean::
92 rm -f *.cm[iox] *.o *.annot
93 rm -f *~ .*~ #*#
94
95depend:
96 $(CAMLDEP) $(INCLUDE_PATH) *.mli *.ml > .depend
97
98distclean::
99 rm -f .depend
100
101.depend:
102 $(CAMLDEP) $(INCLUDE_PATH) *.mli *.ml > .depend
103
104-include .depend