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.
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.
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.
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/>.
17 # The authors reserve the right to distribute this or future versions of
18 # Coccinelle under other licenses.
21 #############################################################################
22 # Configuration section
23 #############################################################################
24 -include ../Makefile.config
26 ##############################################################################
28 ##############################################################################
31 SOURCES= pycocci_aux.ml pycocci.ml
33 INCLUDEDIRS = ../commons ../commons/ocamlextra ../globals ../pycaml \
34 ../parsing_c ../parsing_cocci
36 SYSLIBS = str.cma unix.cma
37 LIBS=../commons/commons.cma ../globals/globals.cma
40 # ../parsing_c/c_parser.cma ../parsing_cocci/cocci_parser.cma
44 ##############################################################################
46 ##############################################################################
48 INCLUDES=$(INCLUDEDIRS:%=-I %) $(INCLUDESEXTRA)
50 ##############################################################################
51 # Generic ocaml variables
52 ##############################################################################
55 OCAMLCFLAGS ?= -g -dtypes
56 OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
57 OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
58 OCAMLDEP = ocamldep$(OPTBIN) #$(INCLUDES)
61 ##############################################################################
63 ##############################################################################
67 OPTLIB=$(LIB:.cma=.cmxa)
71 OBJS = $(SOURCES:.ml=.cmo)
72 OPTOBJS = $(OBJS:.cmo=.cmx)
74 CTLOBJS = $(CTLSOURCES:.ml=.cmo)
75 CTLOPTOBJS = $(CTLOBJS:.cmo=.cmx)
87 $(OCAMLC) -a -o $(LIB) $(OBJS)
94 $(OCAMLOPT) -a -o $(OPTLIB) $(OPTOBJS)
97 $(EXEC): $(OBJS) main.cmo $(LIBS)
98 $(OCAMLC) -o $(EXEC) $(SYSLIBS) $(LIBS) $(OBJS) main.cmo
100 $(CTLEXEC): $(CTLOBJS) $(LIBS)
101 $(OCAMLC) -o $(CTLEXEC) $(SYSLIBS) $(LIBS) $(CTLOBJS)
105 rm -f $(OPTLIB) $(LIB:.cma=.a)
106 rm -f $(TARGET) rm -f $(TARGET).byte
110 #pycocci.ml: ../pycaml/pycaml.ml ../pycaml/pycaml_ml.c
111 #pycocci_aux.ml: ../pycaml/pycaml.ml ../pycaml/pycaml_ml.c
114 rm -f pycocci.ml pycocci_aux.ml
116 ##############################################################################
117 # Generic ocaml rules
118 ##############################################################################
121 .SUFFIXES: .ml .mli .cmo .cmi .cmx
133 # clean rule for others files
135 rm -f *.cm[iox] *.o *.annot
141 $(OCAMLDEP) *.mli *.ml > .depend
144 $(OCAMLDEP) *.mli *.ml > .depend