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