Release coccinelle-0.1.5
[bpt/coccinelle.git] / tools / Makefile
CommitLineData
485bce71 1PROGS=gitgrep split_patch extract_c_and_res #generate_dependencies
34e49164 2
faf9a90c 3all: $(SUBDIRS) $(PROGS)
34e49164
C
4
5# for recursive make
6all.opt: $(PROGS)
7
8gitgrep: gitgrep.ml
9 ocamlopt -o gitgrep str.cmxa gitgrep.ml
10
11gitsort: gitsort.ml
12 ocamlopt -o gitsort str.cmxa gitsort.ml
13
14isoprof: process_isoprofile.ml
15 ocamlc -g -o isoprof str.cma process_isoprofile.ml
16
17alloc_free: alloc_free.ml
18 ocamlopt -o alloc_free str.cmxa alloc_free.ml
19
20# more flexible version of alloc_free
21bridge: bridge.ml
22 ocamlopt -o bridge str.cmxa bridge.ml
23
24install_bridge: bridge
25 cp -f bridge /usr/local/bin
26
faf9a90c
C
27.PHONY: $(SUBDIRS)
28
34e49164
C
29
30SYSLIBS = str.cma unix.cma
31
32INCLUDE=-I ../commons -I ../extra -I ../parsing_c
33LIBS=../commons/commons.cma ../globals/globals.cma \
485bce71 34 ../parsing_c/parsing_c.cma ../extra/extra.cma
34e49164
C
35
36OCAMLC=ocamlc$(OPTBIN) -g -dtypes $(INCLUDE)
37OCAMLOPT=ocamlopt$(OPTBIN) $(INCLUDE) $(OPTFLAGS)
38#OCAMLLEX=ocamllex$(OPTBIN) -ml
39OCAMLLEX=ocamllex$(OPTBIN)
40OCAMLYACC=ocamlyacc -v
faf9a90c 41OCAMLDEP=ocamldep$(OPTBIN) #$(INCLUDE)
34e49164
C
42OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDE)
43
44split_patch: split_patch.cmo
45 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
46
47extract_c_and_res: extract_c_and_res.cmo
48 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
49
34e49164
C
50generate_dependencies: generate_dependencies.cmo
51 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
52
34e49164
C
53.SUFFIXES: .ml .mli .cmo .cmi .cmx
54
55.ml.cmo:
56 $(OCAMLC) -c $<
57.mli.cmi:
58 $(OCAMLC) -c $<
59.ml.cmx:
60 $(OCAMLOPT) -c $<
61
faf9a90c
C
62clean:
63 rm -f $(PROGS)
34e49164
C
64 rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
65
34e49164
C
66beforedepend::
67
68depend:: beforedepend
69 ocamldep $(INCLUDE) *.mli *.ml > .depend
70
71-include .depend