-# Copyright 2005-2008, Ecole des Mines de Nantes, University of Copenhagen
-# Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller
-# This file is part of Coccinelle.
-#
-# Coccinelle is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, according to version 2 of the License.
-#
-# Coccinelle is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
-#
-# The authors reserve the right to distribute this or future versions of
-# Coccinelle under other licenses.
-
+-include ../Makefile.config
TARGET=cocci_parser
SCRIPT_LEXER_SOURCES = lexer_script.mll
PARSER_SOURCES = parser_cocci_menhir.mly
SOURCES = flag_parsing_cocci.ml type_cocci.ml ast_cocci.ml ast0_cocci.ml \
-pretty_print_cocci.ml unparse_ast0.ml \
+pretty_print_cocci.ml unparse_ast0.ml visitor_ast0_types.ml \
visitor_ast.ml visitor_ast0.ml compute_lines.ml comm_assoc.ml \
iso_pattern.ml iso_compile.ml single_statement.ml simple_assignments.ml \
-ast0toast.ml check_meta.ml top_level.ml type_infer.ml test_exps.ml \
-unitary_ast0.ml arity.ml index.ml context_neg.ml \
-insert_plus.ml function_prototypes.ml \
+ast0toast.ml check_meta.ml top_level.ml type_infer.ml \
+test_exps.ml unitary_ast0.ml arity.ml index.ml context_neg.ml \
+adjust_pragmas.ml insert_plus.ml function_prototypes.ml \
unify_ast.ml semantic_cocci.ml data.ml free_vars.ml parse_aux.ml disjdistr.ml \
$(LEXER_SOURCES:.mll=.ml) $(PARSER_SOURCES:.mly=.ml) \
$(SCRIPT_LEXER_SOURCES:.mll=.ml) \
-get_constants.ml get_constants2.ml parse_cocci.ml
+get_constants.ml get_constants2.ml adjacency.ml parse_cocci.ml
-LIBS=../commons/commons.cma ../globals/globals.cma
+LIBS=../commons/commons.cma ../globals/globals.cma
SYSLIBS = str.cma unix.cma
#MENHIR_PATH=$(shell ocamlfind query menhirLib)
all.opt: $(OPTLIB)
-
$(LIB): $(GENERATED) $(OBJS)
$(OCAMLC) -I $(MENHIR_PATH) -a -o $(LIB) $(MENHIR) $(OBJS)
-$(OPTLIB): $(GENERATED) $(OPTOBJS)
+$(OPTLIB): $(GENERATED) $(OPTOBJS)
$(OCAMLOPT) -I $(MENHIR_PATH) -a -o $(OPTLIB) $(MENHIRO) $(OPTOBJS)
clean::
rm -f $(LIB)
- rm -f $(OPTLIB) $(LIB:.cma=.a)
+ rm -f $(OPTLIB) $(LIB:.cma=.a)
rm -f $(TARGET)
$(SCRIPT_LEXER_SOURCES:.mll=.ml): $(SCRIPT_LEXER_SOURCES)
$(OCAMLLEX) $(SCRIPT_LEXER_SOURCES)
-clean::
+distclean::
rm -f $(GENERATED)
# clean rule for others files
clean::
rm -f *.cm[iox] *.o *.annot
- rm -f *~ .*~ #*#
+ rm -f *~ .*~ #*#
+
+distclean::
+ rm -f .depend
depend: $(GENERATED)
$(OCAMLDEP) *.mli *.ml > .depend