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