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.
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 ##############################################################################
23 ##############################################################################
25 -include ..
/Makefile.config
30 SRC
= flag_matcher.ml lib_engine.ml pretty_print_engine.ml \
31 check_exhaustive_pattern.ml \
32 check_reachability.ml \
33 c_vs_c.ml isomorphisms_c_c.ml \
34 cocci_vs_c.ml pattern_c.ml sgrep.ml transformation_c.ml \
35 asttomember.ml asttoctl2.ml ctltotex.ml \
36 postprocess_transinfo.ml ctlcocci_integration.ml
39 #SRC= flag_matcher.ml \
40 # c_vs_c.ml cocci_vs_c.ml \
42 # pattern_c.ml transformation_c.ml
44 #LIBS=../commons/commons.cma ../parsing_c/parsing_c.cma
45 #INCLUDES= -I ../commons -I ../parsing_c
46 INCLUDES
= -I ..
/commons
-I ..
/commons
/ocamlextra
-I ..
/globals \
47 -I ..
/ctl
-I ..
/parsing_cocci
-I ..
/parsing_c
48 LIBS
=..
/commons
/commons.cma ..
/globals
/globals.cma \
49 ..
/ctl
/ctl.cma ..
/parsing_c
/parsing_c.cma ..
/parsing_cocci
/cocci_parser.cma
51 SYSLIBS
= str.cma unix.cma
54 # just to test asttoctl
55 # CTLSOURCES = lib_engine.ml pretty_print_engine.ml asttoctl.ml ctltotex.ml \
58 ##############################################################################
60 ##############################################################################
63 #for profiling: -p -inline 0 with OCAMLOPT
64 OCAMLCFLAGS ?
= -g
-dtypes
66 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
67 OCAMLOPT
=ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
68 OCAMLLEX
=ocamllex
$(OPTBIN
) #-ml
69 OCAMLYACC
=ocamlyacc
-v
70 OCAMLDEP
=ocamldep
$(OPTBIN
) $(INCLUDES
)
71 OCAMLMKTOP
=ocamlmktop
-g
-custom
$(INCLUDES
)
74 OBJS
= $(SRC
:.ml
=.cmo
)
75 OPTOBJS
= $(SRC
:.ml
=.cmx
)
78 ##############################################################################
80 ##############################################################################
82 all.opt
: $(TARGET
).cmxa
84 $(TARGET
).cma
: $(OBJS
)
85 $(OCAMLC
) -a
-o
$(TARGET
).cma
$(OBJS
)
87 $(TARGET
).cmxa
: $(OPTOBJS
) $(LIBS
:.cma
=.cmxa
)
88 $(OCAMLOPT
) -a
-o
$(TARGET
).cmxa
$(OPTOBJS
)
90 $(TARGET
).top
: $(OBJS
) $(LIBS
)
91 $(OCAMLMKTOP
) -o
$(TARGET
).top
$(SYSLIBS
) $(LIBS
) $(OBJS
)
98 ##############################################################################
100 ##############################################################################
102 ##############################################################################
104 ##############################################################################
106 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
119 rm -f
*.cm
[ioxa
] *.o
*.a
*.cmxa
*.annot
120 rm -f
*~ .
*~ gmon.out
#*#
127 depend
:: beforedepend
128 $(OCAMLDEP
) *.mli
*.ml
> .depend