Release coccinelle-0.1.4
[bpt/coccinelle.git] / tools / Makefile
1 PROGS=gitgrep split_patch extract_c_and_res #generate_dependencies
2
3 all: $(SUBDIRS) $(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 .PHONY: $(SUBDIRS)
28
29
30 SYSLIBS = str.cma unix.cma
31
32 INCLUDE=-I ../commons -I ../extra -I ../parsing_c
33 LIBS=../commons/commons.cma ../globals/globals.cma \
34 ../parsing_c/parsing_c.cma ../extra/extra.cma
35
36 OCAMLC=ocamlc$(OPTBIN) -g -dtypes $(INCLUDE)
37 OCAMLOPT=ocamlopt$(OPTBIN) $(INCLUDE) $(OPTFLAGS)
38 #OCAMLLEX=ocamllex$(OPTBIN) -ml
39 OCAMLLEX=ocamllex$(OPTBIN)
40 OCAMLYACC=ocamlyacc -v
41 OCAMLDEP=ocamldep$(OPTBIN) #$(INCLUDE)
42 OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDE)
43
44 split_patch: split_patch.cmo
45 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
46
47 extract_c_and_res: extract_c_and_res.cmo
48 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
49
50 generate_dependencies: generate_dependencies.cmo
51 $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+
52
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
62 clean:
63 rm -f $(PROGS)
64 rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
65
66 beforedepend::
67
68 depend:: beforedepend
69 ocamldep $(INCLUDE) *.mli *.ml > .depend
70
71 -include .depend