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