Release coccinelle-0.2.0
[bpt/coccinelle.git] / tools / Makefile
CommitLineData
9f8e26f4
C
1# Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
2# Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
3# This file is part of Coccinelle.
4#
5# Coccinelle is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, according to version 2 of the License.
8#
9# Coccinelle is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
16#
17# The authors reserve the right to distribute this or future versions of
18# Coccinelle under other licenses.
19
20
0708f913
C
21-include ../Makefile.config
22
978fd7e5 23PROGS=spp gitgrep split_patch extract_c_and_res #generate_dependencies
34e49164 24
faf9a90c 25all: $(SUBDIRS) $(PROGS)
34e49164
C
26
27# for recursive make
28all.opt: $(PROGS)
29
30gitgrep: gitgrep.ml
31 ocamlopt -o gitgrep str.cmxa gitgrep.ml
32
33gitsort: gitsort.ml
34 ocamlopt -o gitsort str.cmxa gitsort.ml
35
36isoprof: process_isoprofile.ml
37 ocamlc -g -o isoprof str.cma process_isoprofile.ml
38
39alloc_free: alloc_free.ml
40 ocamlopt -o alloc_free str.cmxa alloc_free.ml
41
42# more flexible version of alloc_free
43bridge: bridge.ml
44 ocamlopt -o bridge str.cmxa bridge.ml
45
46install_bridge: bridge
47 cp -f bridge /usr/local/bin
48
faf9a90c
C
49.PHONY: $(SUBDIRS)
50
34e49164 51
978fd7e5 52SYSLIBS = str.cma unix.cma bigarray.cma
34e49164
C
53
54INCLUDE=-I ../commons -I ../extra -I ../parsing_c
55LIBS=../commons/commons.cma ../globals/globals.cma \
b1b2de81 56 ../parsing_c/parsing_c.cma ../extra/extra.cma
34e49164 57
b1b2de81 58OCAMLC=ocamlc$(OPTBIN) -g -dtypes $(INCLUDE)
34e49164
C
59OCAMLOPT=ocamlopt$(OPTBIN) $(INCLUDE) $(OPTFLAGS)
60#OCAMLLEX=ocamllex$(OPTBIN) -ml
61OCAMLLEX=ocamllex$(OPTBIN)
62OCAMLYACC=ocamlyacc -v
0708f913 63OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDE)
34e49164
C
64OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDE)
65
978fd7e5
C
66spp: spp.ml
67 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
68# ocamlc -I ../commons/ -o spp str.cma unix.cma bigarray.cma ../commons/common.cmo spp.ml
69
34e49164
C
70split_patch: split_patch.cmo
71 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
72
73extract_c_and_res: extract_c_and_res.cmo
74 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
75
34e49164
C
76generate_dependencies: generate_dependencies.cmo
77 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
78
34e49164
C
79.SUFFIXES: .ml .mli .cmo .cmi .cmx
80
81.ml.cmo:
82 $(OCAMLC) -c $<
83.mli.cmi:
84 $(OCAMLC) -c $<
85.ml.cmx:
86 $(OCAMLOPT) -c $<
87
faf9a90c
C
88clean:
89 rm -f $(PROGS)
34e49164
C
90 rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
91
34e49164
C
92beforedepend::
93
94depend:: beforedepend
95 ocamldep $(INCLUDE) *.mli *.ml > .depend
96
b1b2de81
C
97distclean::
98 rm -f .depend
99
34e49164 100-include .depend