Commit | Line | Data |
---|---|---|
17ba0788 C |
1 | # Copyright 2012, INRIA |
2 | # Julia Lawall, Gilles Muller | |
3 | # Copyright 2010-2011, INRIA, University of Copenhagen | |
f537ebc4 C |
4 | # Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix |
5 | # Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen | |
6 | # Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix | |
7 | # This file is part of Coccinelle. | |
8 | # | |
9 | # Coccinelle is free software: you can redistribute it and/or modify | |
10 | # it under the terms of the GNU General Public License as published by | |
11 | # the Free Software Foundation, according to version 2 of the License. | |
12 | # | |
13 | # Coccinelle is distributed in the hope that it will be useful, | |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | # GNU General Public License for more details. | |
17 | # | |
18 | # You should have received a copy of the GNU General Public License | |
19 | # along with Coccinelle. If not, see <http://www.gnu.org/licenses/>. | |
20 | # | |
21 | # The authors reserve the right to distribute this or future versions of | |
22 | # Coccinelle under other licenses. | |
23 | ||
24 | ||
0708f913 C |
25 | -include ../Makefile.config |
26 | ||
c491d8ee | 27 | PROGS=spp gitgrep splitpatch extract_c_and_res #generate_dependencies |
34e49164 | 28 | |
faf9a90c | 29 | all: $(SUBDIRS) $(PROGS) |
34e49164 C |
30 | |
31 | # for recursive make | |
32 | all.opt: $(PROGS) | |
33 | ||
34 | gitgrep: gitgrep.ml | |
35 | ocamlopt -o gitgrep str.cmxa gitgrep.ml | |
36 | ||
37 | gitsort: gitsort.ml | |
38 | ocamlopt -o gitsort str.cmxa gitsort.ml | |
39 | ||
40 | isoprof: process_isoprofile.ml | |
41 | ocamlc -g -o isoprof str.cma process_isoprofile.ml | |
42 | ||
43 | alloc_free: alloc_free.ml | |
44 | ocamlopt -o alloc_free str.cmxa alloc_free.ml | |
45 | ||
46 | # more flexible version of alloc_free | |
47 | bridge: bridge.ml | |
413ffc02 | 48 | ocamlopt -o bridge str.cmxa dumper.mli dumper.ml bridge.ml |
34e49164 C |
49 | |
50 | install_bridge: bridge | |
51 | cp -f bridge /usr/local/bin | |
52 | ||
faf9a90c C |
53 | .PHONY: $(SUBDIRS) |
54 | ||
34e49164 | 55 | |
978fd7e5 | 56 | SYSLIBS = str.cma unix.cma bigarray.cma |
34e49164 C |
57 | |
58 | INCLUDE=-I ../commons -I ../extra -I ../parsing_c | |
59 | LIBS=../commons/commons.cma ../globals/globals.cma \ | |
b1b2de81 | 60 | ../parsing_c/parsing_c.cma ../extra/extra.cma |
34e49164 | 61 | |
b1b2de81 | 62 | OCAMLC=ocamlc$(OPTBIN) -g -dtypes $(INCLUDE) |
34e49164 C |
63 | OCAMLOPT=ocamlopt$(OPTBIN) $(INCLUDE) $(OPTFLAGS) |
64 | #OCAMLLEX=ocamllex$(OPTBIN) -ml | |
65 | OCAMLLEX=ocamllex$(OPTBIN) | |
66 | OCAMLYACC=ocamlyacc -v | |
0708f913 | 67 | OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDE) |
34e49164 C |
68 | OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDE) |
69 | ||
978fd7e5 C |
70 | spp: spp.ml |
71 | $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+ | |
72 | # ocamlc -I ../commons/ -o spp str.cma unix.cma bigarray.cma ../commons/common.cmo spp.ml | |
73 | ||
c491d8ee C |
74 | splitpatch: splitpatch.cmo |
75 | $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $+ | |
34e49164 C |
76 | |
77 | extract_c_and_res: extract_c_and_res.cmo | |
78 | $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+ | |
79 | ||
34e49164 C |
80 | generate_dependencies: generate_dependencies.cmo |
81 | $(OCAMLC) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+ | |
82 | ||
34e49164 C |
83 | .SUFFIXES: .ml .mli .cmo .cmi .cmx |
84 | ||
85 | .ml.cmo: | |
86 | $(OCAMLC) -c $< | |
87 | .mli.cmi: | |
88 | $(OCAMLC) -c $< | |
89 | .ml.cmx: | |
90 | $(OCAMLOPT) -c $< | |
91 | ||
faf9a90c C |
92 | clean: |
93 | rm -f $(PROGS) | |
34e49164 C |
94 | rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot |
95 | ||
34e49164 C |
96 | beforedepend:: |
97 | ||
98 | depend:: beforedepend | |
99 | ocamldep $(INCLUDE) *.mli *.ml > .depend | |
100 | ||
c491d8ee | 101 | distclean:: clean |
b1b2de81 C |
102 | rm -f .depend |
103 | ||
34e49164 | 104 | -include .depend |