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 ifneq ($(MAKECMDGOALS
),distclean)
30 include ..
/Makefile.config
36 SRC
= flag_matcher.ml lib_engine.ml pretty_print_engine.ml \
37 check_exhaustive_pattern.ml \
38 check_reachability.ml \
39 c_vs_c.ml isomorphisms_c_c.ml \
40 cocci_vs_c.ml pattern_c.ml transformation_c.ml \
41 asttomember.ml asttoctl2.ml ctltotex.ml \
42 postprocess_transinfo.ml ctlcocci_integration.ml
44 INCLUDES
= -I ..
/commons
-I ..
/commons
/ocamlextra
-I ..
/globals \
45 -I ..
/ctl
-I ..
/parsing_cocci
-I ..
/parsing_c
46 LIBS
=..
/commons
/commons.cma ..
/globals
/globals.cma \
47 ..
/ctl
/ctl.cma ..
/parsing_c
/parsing_c.cma ..
/parsing_cocci
/cocci_parser.cma
49 SYSLIBS
= str.cma unix.cma
52 # just to test asttoctl
53 # CTLSOURCES = lib_engine.ml pretty_print_engine.ml asttoctl.ml ctltotex.ml \
56 ##############################################################################
58 ##############################################################################
61 #for profiling: -p -inline 0 with OCAMLOPT
62 OCAMLCFLAGS ?
= -g
-dtypes
63 OPTFLAGS ?
= -g
-dtypes
65 OCAMLC_CMD
=$(OCAMLC
) -thread
$(OCAMLCFLAGS
) $(INCLUDES
)
66 OCAMLOPT_CMD
=$(OCAMLOPT
) -thread
$(OPTFLAGS
) $(INCLUDES
)
67 OCAMLDEP_CMD
=$(OCAMLDEP
) $(INCLUDESDEP
)
68 OCAMLMKTOP_CMD
=$(OCAMLMKTOP
) -g
-custom
$(INCLUDES
)
70 OBJS
= $(SRC
:.ml
=.cmo
)
71 OPTOBJS
= $(SRC
:.ml
=.cmx
)
74 ##############################################################################
76 ##############################################################################
79 @
$(MAKE
) $(TARGET
).cmxa BUILD_OPT
=yes
81 $(TARGET
).cma
: $(OBJS
)
82 $(OCAMLC_CMD
) -a
-o
$(TARGET
).cma
$(OBJS
)
84 $(TARGET
).cmxa
: $(OPTOBJS
) $(LIBS
:.cma
=.cmxa
)
85 $(OCAMLOPT_CMD
) -a
-o
$(TARGET
).cmxa
$(OPTOBJS
)
87 $(TARGET
).top
: $(OBJS
) $(LIBS
)
88 $(OCAMLMKTOP_CMD
) -o
$(TARGET
).top
$(SYSLIBS
) $(LIBS
) $(OBJS
)
95 ##############################################################################
97 ##############################################################################
99 ##############################################################################
101 ##############################################################################
103 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
110 $(OCAMLOPT_CMD
) -c
$<
116 rm -f
*.cm
[ioxa
] *.o
*.a
*.cmxa
*.annot
117 rm -f
*~ .
*~ gmon.out
#*#
124 $(OCAMLDEP_CMD
) *.mli
*.ml
> .depend
126 ifneq ($(MAKECMDGOALS
),clean)
127 ifneq ($(MAKECMDGOALS
),distclean)
132 include ..
/Makefile.common