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