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