Commit | Line | Data |
---|---|---|
0708f913 C |
1 | -include ../Makefile.config |
2 | ||
978fd7e5 | 3 | PROGS=spp gitgrep split_patch extract_c_and_res #generate_dependencies |
34e49164 | 4 | |
faf9a90c | 5 | all: $(SUBDIRS) $(PROGS) |
34e49164 C |
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 | ||
faf9a90c C |
29 | .PHONY: $(SUBDIRS) |
30 | ||
34e49164 | 31 | |
978fd7e5 | 32 | SYSLIBS = str.cma unix.cma bigarray.cma |
34e49164 C |
33 | |
34 | INCLUDE=-I ../commons -I ../extra -I ../parsing_c | |
35 | LIBS=../commons/commons.cma ../globals/globals.cma \ | |
b1b2de81 | 36 | ../parsing_c/parsing_c.cma ../extra/extra.cma |
34e49164 | 37 | |
b1b2de81 | 38 | OCAMLC=ocamlc$(OPTBIN) -g -dtypes $(INCLUDE) |
34e49164 C |
39 | OCAMLOPT=ocamlopt$(OPTBIN) $(INCLUDE) $(OPTFLAGS) |
40 | #OCAMLLEX=ocamllex$(OPTBIN) -ml | |
41 | OCAMLLEX=ocamllex$(OPTBIN) | |
42 | OCAMLYACC=ocamlyacc -v | |
0708f913 | 43 | OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDE) |
34e49164 C |
44 | OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDE) |
45 | ||
978fd7e5 C |
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 | ||
34e49164 C |
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 | ||
34e49164 C |
56 | generate_dependencies: generate_dependencies.cmo |
57 | $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+ | |
58 | ||
34e49164 C |
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 | ||
faf9a90c C |
68 | clean: |
69 | rm -f $(PROGS) | |
34e49164 C |
70 | rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot |
71 | ||
34e49164 C |
72 | beforedepend:: |
73 | ||
74 | depend:: beforedepend | |
75 | ocamldep $(INCLUDE) *.mli *.ml > .depend | |
76 | ||
b1b2de81 C |
77 | distclean:: |
78 | rm -f .depend | |
79 | ||
34e49164 | 80 | -include .depend |