1 # Copyright 2010, INRIA, University of Copenhagen
2 # Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
3 # Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
4 # Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
5 # This file is part of Coccinelle.
7 # Coccinelle is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, according to version 2 of the License.
11 # Coccinelle is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
19 # The authors reserve the right to distribute this or future versions of
20 # Coccinelle under other licenses.
23 #############################################################################
24 # Configuration section
25 #############################################################################
26 -include ..
/Makefile.config
28 ##############################################################################
30 ##############################################################################
33 SOURCES
= pycocci_aux.ml pycocci.ml
35 ifeq ("$(PYCAMLDIR)", "pycaml")
36 INCLUDEDIRS
= ..
/commons ..
/commons
/ocamlextra ..
/globals ..
/$(PYCAMLDIR
) \
37 ..
/parsing_c ..
/parsing_cocci
39 INCLUDEDIRS
= ..
/commons ..
/commons
/ocamlextra ..
/globals
$(PYCAMLDIR
) \
40 ..
/parsing_c ..
/parsing_cocci
43 SYSLIBS
= str.cma unix.cma pycaml.cma
44 LIBS
=..
/commons
/commons.cma ..
/globals
/globals.cma
46 ##############################################################################
48 ##############################################################################
50 INCLUDES
=$(INCLUDEDIRS
:%=-I
%) $(INCLUDESEXTRA
)
52 ##############################################################################
53 # Generic ocaml variables
54 ##############################################################################
57 OCAMLCFLAGS ?
= -g
-dtypes
58 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
59 OCAMLOPT
= ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
60 OCAMLDEP
= ocamldep
$(OPTBIN
) $(INCLUDES
)
63 ##############################################################################
65 ##############################################################################
69 OPTLIB
=$(LIB
:.cma
=.cmxa
)
73 OBJS
= $(SOURCES
:.ml
=.cmo
)
74 OPTOBJS
= $(OBJS
:.cmo
=.cmx
)
76 CTLOBJS
= $(CTLSOURCES
:.ml
=.cmo
)
77 CTLOPTOBJS
= $(CTLOBJS
:.cmo
=.cmx
)
89 $(OCAMLC
) -a
-o
$(LIB
) $(OBJS
)
96 $(OCAMLOPT
) -a
-o
$(OPTLIB
) $(OPTOBJS
)
99 $(EXEC
): $(OBJS
) main.cmo
$(LIBS
)
100 $(OCAMLC
) -o
$(EXEC
) $(SYSLIBS
) $(LIBS
) $(OBJS
) main.cmo
102 $(CTLEXEC
): $(CTLOBJS
) $(LIBS
)
103 $(OCAMLC
) -o
$(CTLEXEC
) $(SYSLIBS
) $(LIBS
) $(CTLOBJS
)
107 rm -f
$(OPTLIB
) $(LIB
:.cma
=.a
)
108 rm -f
$(TARGET
) rm -f
$(TARGET
).byte
112 #pycocci.ml: ../pycaml/pycaml.ml ../pycaml/pycaml_ml.c
113 #pycocci_aux.ml: ../pycaml/pycaml.ml ../pycaml/pycaml_ml.c
115 @echo
"\n\n\t*** pycocci_aux.ml not found ! ***\n\n\tRun 'configure && make depend' first.\n\n"
118 rm -f pycocci.ml pycocci_aux.ml
120 ##############################################################################
121 # Generic ocaml rules
122 ##############################################################################
125 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
137 # clean rule for others files
139 rm -f
*.cm
[iox
] *.o
*.annot
148 $(OCAMLDEP
) *.mli
*.ml
> .depend
151 $(OCAMLDEP
) *.mli
*.ml
> .depend