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.
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.
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.
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/>.
21 # The authors reserve the right to distribute this or future versions of
22 # Coccinelle under other licenses.
25 ##############################################################################
27 ##############################################################################
29 -include ..
/Makefile.config
34 SRC
= flag_matcher.ml lib_engine.ml pretty_print_engine.ml \
35 check_exhaustive_pattern.ml \
36 check_reachability.ml \
37 c_vs_c.ml isomorphisms_c_c.ml \
38 cocci_vs_c.ml pattern_c.ml transformation_c.ml \
39 asttomember.ml asttoctl2.ml ctltotex.ml \
40 postprocess_transinfo.ml ctlcocci_integration.ml
43 #SRC= flag_matcher.ml \
44 # c_vs_c.ml cocci_vs_c.ml \
46 # pattern_c.ml transformation_c.ml
48 #LIBS=../commons/commons.cma ../parsing_c/parsing_c.cma
49 #INCLUDES= -I ../commons -I ../parsing_c
50 INCLUDES
= -I ..
/commons
-I ..
/commons
/ocamlextra
-I ..
/globals \
51 -I ..
/ctl
-I ..
/parsing_cocci
-I ..
/parsing_c
52 LIBS
=..
/commons
/commons.cma ..
/globals
/globals.cma \
53 ..
/ctl
/ctl.cma ..
/parsing_c
/parsing_c.cma ..
/parsing_cocci
/cocci_parser.cma
55 SYSLIBS
= str.cma unix.cma
58 # just to test asttoctl
59 # CTLSOURCES = lib_engine.ml pretty_print_engine.ml asttoctl.ml ctltotex.ml \
62 ##############################################################################
64 ##############################################################################
67 #for profiling: -p -inline 0 with OCAMLOPT
68 OCAMLCFLAGS ?
= -g
-dtypes
70 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
71 OCAMLOPT
=ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
72 OCAMLLEX
=ocamllex
$(OPTBIN
) #-ml
73 OCAMLYACC
=ocamlyacc
-v
74 OCAMLDEP
=ocamldep
$(OPTBIN
) $(INCLUDES
)
75 OCAMLMKTOP
=ocamlmktop
-g
-custom
$(INCLUDES
)
78 OBJS
= $(SRC
:.ml
=.cmo
)
79 OPTOBJS
= $(SRC
:.ml
=.cmx
)
82 ##############################################################################
84 ##############################################################################
86 all.opt
: $(TARGET
).cmxa
88 $(TARGET
).cma
: $(OBJS
)
89 $(OCAMLC
) -a
-o
$(TARGET
).cma
$(OBJS
)
91 $(TARGET
).cmxa
: $(OPTOBJS
) $(LIBS
:.cma
=.cmxa
)
92 $(OCAMLOPT
) -a
-o
$(TARGET
).cmxa
$(OPTOBJS
)
94 $(TARGET
).top
: $(OBJS
) $(LIBS
)
95 $(OCAMLMKTOP
) -o
$(TARGET
).top
$(SYSLIBS
) $(LIBS
) $(OBJS
)
102 ##############################################################################
104 ##############################################################################
106 ##############################################################################
108 ##############################################################################
110 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
123 rm -f
*.cm
[ioxa
] *.o
*.a
*.cmxa
*.annot
124 rm -f
*~ .
*~ gmon.out
#*#
131 depend
:: beforedepend
132 $(OCAMLDEP
) *.mli
*.ml
> .depend