Release coccinelle-0.2.0rc1
[bpt/coccinelle.git] / parsing_cocci / Makefile
index 027e433..f032147 100644 (file)
@@ -1,22 +1,4 @@
-# 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
 
@@ -24,18 +6,18 @@ LEXER_SOURCES = lexer_cocci.mll
 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)
@@ -71,12 +53,11 @@ local: $(EXEC)
 
 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)
 
 
@@ -88,7 +69,7 @@ $(EXEC): $(OBJS) main.cmo $(LIBS)
 
 clean::
        rm -f $(LIB)
-       rm -f $(OPTLIB) $(LIB:.cma=.a)  
+       rm -f $(OPTLIB) $(LIB:.cma=.a)
        rm -f $(TARGET)
 
 
@@ -115,13 +96,16 @@ $(PARSER_SOURCES:.mly=.ml) $(PARSER_SOURCES:.mly=.mli) : $(PARSER_SOURCES)
 $(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