Release of coccinelle 1.0.0-rc9
[bpt/coccinelle.git] / tools / Makefile
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.
6 #
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.
10 #
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.
15 #
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/>.
18 #
19 # The authors reserve the right to distribute this or future versions of
20 # Coccinelle under other licenses.
21
22
23 -include ../Makefile.config
24
25 PROGS=spp gitgrep splitpatch extract_c_and_res #generate_dependencies
26
27 all: $(SUBDIRS) $(PROGS)
28
29 # for recursive make
30 all.opt: $(PROGS)
31
32 gitgrep: gitgrep.ml
33 ocamlopt -o gitgrep str.cmxa gitgrep.ml
34
35 gitsort: gitsort.ml
36 ocamlopt -o gitsort str.cmxa gitsort.ml
37
38 isoprof: process_isoprofile.ml
39 ocamlc -g -o isoprof str.cma process_isoprofile.ml
40
41 alloc_free: alloc_free.ml
42 ocamlopt -o alloc_free str.cmxa alloc_free.ml
43
44 # more flexible version of alloc_free
45 bridge: bridge.ml
46 ocamlopt -o bridge str.cmxa dumper.mli dumper.ml bridge.ml
47
48 install_bridge: bridge
49 cp -f bridge /usr/local/bin
50
51 .PHONY: $(SUBDIRS)
52
53
54 SYSLIBS = str.cma unix.cma bigarray.cma
55
56 INCLUDE=-I ../commons -I ../extra -I ../parsing_c
57 LIBS=../commons/commons.cma ../globals/globals.cma \
58 ../parsing_c/parsing_c.cma ../extra/extra.cma
59
60 OCAMLC=ocamlc$(OPTBIN) -g -dtypes $(INCLUDE)
61 OCAMLOPT=ocamlopt$(OPTBIN) $(INCLUDE) $(OPTFLAGS)
62 #OCAMLLEX=ocamllex$(OPTBIN) -ml
63 OCAMLLEX=ocamllex$(OPTBIN)
64 OCAMLYACC=ocamlyacc -v
65 OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDE)
66 OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDE)
67
68 spp: spp.ml
69 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
70 # ocamlc -I ../commons/ -o spp str.cma unix.cma bigarray.cma ../commons/common.cmo spp.ml
71
72 splitpatch: splitpatch.cmo
73 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $+
74
75 extract_c_and_res: extract_c_and_res.cmo
76 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
77
78 generate_dependencies: generate_dependencies.cmo
79 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
80
81 .SUFFIXES: .ml .mli .cmo .cmi .cmx
82
83 .ml.cmo:
84 $(OCAMLC) -c $<
85 .mli.cmi:
86 $(OCAMLC) -c $<
87 .ml.cmx:
88 $(OCAMLOPT) -c $<
89
90 clean:
91 rm -f $(PROGS)
92 rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
93
94 beforedepend::
95
96 depend:: beforedepend
97 ocamldep $(INCLUDE) *.mli *.ml > .depend
98
99 distclean:: clean
100 rm -f .depend
101
102 -include .depend