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 | ||
feec80c3 C |
25 | ifneq ($(MAKECMDGOALS),distclean) |
26 | include ../Makefile.config | |
27 | endif | |
0708f913 | 28 | |
755320b0 C |
29 | OCAMLCFLAGS ?= -g |
30 | OPTFLAGS ?= -g | |
d6ce1786 | 31 | |
c491d8ee | 32 | PROGS=spp gitgrep splitpatch extract_c_and_res #generate_dependencies |
34e49164 | 33 | |
faf9a90c | 34 | all: $(SUBDIRS) $(PROGS) |
34e49164 | 35 | |
d6ce1786 C |
36 | all.opt: |
37 | @$(MAKE) $(PROGS) BUILD_OPT=yes | |
34e49164 C |
38 | |
39 | gitgrep: gitgrep.ml | |
feec80c3 | 40 | $(OCAMLOPT) -o gitgrep str.cmxa gitgrep.ml |
34e49164 C |
41 | |
42 | gitsort: gitsort.ml | |
feec80c3 | 43 | $(OCAMLOPT) -o gitsort str.cmxa gitsort.ml |
34e49164 C |
44 | |
45 | isoprof: process_isoprofile.ml | |
feec80c3 | 46 | $(OCAMLC) -g -o isoprof str.cma process_isoprofile.ml |
34e49164 C |
47 | |
48 | alloc_free: alloc_free.ml | |
feec80c3 | 49 | $(OCAMLOPT) -o alloc_free str.cmxa alloc_free.ml |
34e49164 C |
50 | |
51 | # more flexible version of alloc_free | |
52 | bridge: bridge.ml | |
feec80c3 | 53 | $(OCAMLOPT) -o bridge str.cmxa dumper.mli dumper.ml bridge.ml |
34e49164 C |
54 | |
55 | install_bridge: bridge | |
56 | cp -f bridge /usr/local/bin | |
57 | ||
faf9a90c C |
58 | .PHONY: $(SUBDIRS) |
59 | ||
34e49164 | 60 | |
978fd7e5 | 61 | SYSLIBS = str.cma unix.cma bigarray.cma |
34e49164 C |
62 | |
63 | INCLUDE=-I ../commons -I ../extra -I ../parsing_c | |
64 | LIBS=../commons/commons.cma ../globals/globals.cma \ | |
b1b2de81 | 65 | ../parsing_c/parsing_c.cma ../extra/extra.cma |
34e49164 | 66 | |
755320b0 C |
67 | OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDE) |
68 | OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDE) | |
feec80c3 C |
69 | OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDE) |
70 | OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDE) | |
71 | OCAMLYACC_CMD=$(OCAMLYACC) -v | |
34e49164 | 72 | |
978fd7e5 | 73 | spp: spp.ml |
feec80c3 | 74 | $(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+ |
978fd7e5 | 75 | |
c491d8ee | 76 | splitpatch: splitpatch.cmo |
feec80c3 | 77 | $(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $+ |
34e49164 C |
78 | |
79 | extract_c_and_res: extract_c_and_res.cmo | |
feec80c3 | 80 | $(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+ |
34e49164 | 81 | |
34e49164 | 82 | generate_dependencies: generate_dependencies.cmo |
feec80c3 | 83 | $(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+ |
34e49164 | 84 | |
34e49164 C |
85 | .SUFFIXES: .ml .mli .cmo .cmi .cmx |
86 | ||
87 | .ml.cmo: | |
feec80c3 | 88 | $(OCAMLC_CMD) -c $< |
34e49164 | 89 | .mli.cmi: |
feec80c3 | 90 | $(OCAMLC_CMD) -c $< |
34e49164 | 91 | .ml.cmx: |
feec80c3 | 92 | $(OCAMLOPT_CMD) -c $< |
34e49164 | 93 | |
faf9a90c C |
94 | clean: |
95 | rm -f $(PROGS) | |
34e49164 | 96 | rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot |
feec80c3 | 97 | rm -f .depend |
34e49164 | 98 | |
feec80c3 | 99 | distclean: clean |
34e49164 | 100 | |
feec80c3 C |
101 | .PHONEY: depend |
102 | .depend depend: beforedepend | |
103 | ocamldep $(INCLUDE) *.mli *.ml > .depend | |
b1b2de81 | 104 | |
feec80c3 C |
105 | ifneq ($(MAKECMDGOALS),clean) |
106 | ifneq ($(MAKECMDGOALS),distclean) | |
34e49164 | 107 | -include .depend |
feec80c3 C |
108 | endif |
109 | endif | |
d6ce1786 C |
110 | |
111 | include ../Makefile.common |