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 | ||
485bce71 C |
25 | ############################################################################## |
26 | # Variables | |
27 | ############################################################################## | |
28 | #TARGET=matcher | |
0708f913 C |
29 | -include ../Makefile.config |
30 | ||
34e49164 C |
31 | TARGET=cocciengine |
32 | CTLTARGET=engine | |
33 | ||
485bce71 C |
34 | SRC= flag_matcher.ml lib_engine.ml pretty_print_engine.ml \ |
35 | check_exhaustive_pattern.ml \ | |
36 | check_reachability.ml \ | |
37 | c_vs_c.ml isomorphisms_c_c.ml \ | |
8babbc8f | 38 | cocci_vs_c.ml pattern_c.ml transformation_c.ml \ |
485bce71 | 39 | asttomember.ml asttoctl2.ml ctltotex.ml \ |
0708f913 | 40 | postprocess_transinfo.ml ctlcocci_integration.ml |
485bce71 C |
41 | |
42 | #c_vs_c.ml | |
43 | #SRC= flag_matcher.ml \ | |
44 | # c_vs_c.ml cocci_vs_c.ml \ | |
45 | # lib_engine.ml \ | |
b1b2de81 | 46 | # pattern_c.ml transformation_c.ml |
485bce71 C |
47 | |
48 | #LIBS=../commons/commons.cma ../parsing_c/parsing_c.cma | |
49 | #INCLUDES= -I ../commons -I ../parsing_c | |
50 | INCLUDES = -I ../commons -I ../commons/ocamlextra -I ../globals \ | |
b1b2de81 | 51 | -I ../ctl -I ../parsing_cocci -I ../parsing_c |
485bce71 C |
52 | LIBS=../commons/commons.cma ../globals/globals.cma \ |
53 | ../ctl/ctl.cma ../parsing_c/parsing_c.cma ../parsing_cocci/cocci_parser.cma | |
54 | ||
b1b2de81 | 55 | SYSLIBS= str.cma unix.cma |
485bce71 | 56 | |
34e49164 C |
57 | |
58 | # just to test asttoctl | |
59 | # CTLSOURCES = lib_engine.ml pretty_print_engine.ml asttoctl.ml ctltotex.ml \ | |
60 | # main.ml | |
61 | ||
485bce71 C |
62 | ############################################################################## |
63 | # Generic variables | |
64 | ############################################################################## | |
34e49164 | 65 | |
b1b2de81 | 66 | #for warning: -w A |
485bce71 | 67 | #for profiling: -p -inline 0 with OCAMLOPT |
34e49164 | 68 | OCAMLCFLAGS ?= -g -dtypes |
34e49164 | 69 | |
485bce71 C |
70 | OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES) |
71 | OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES) | |
72 | OCAMLLEX=ocamllex$(OPTBIN) #-ml | |
73 | OCAMLYACC=ocamlyacc -v | |
0708f913 | 74 | OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDES) |
485bce71 | 75 | OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES) |
34e49164 | 76 | |
34e49164 | 77 | |
485bce71 C |
78 | OBJS = $(SRC:.ml=.cmo) |
79 | OPTOBJS = $(SRC:.ml=.cmx) | |
34e49164 | 80 | |
34e49164 | 81 | |
485bce71 C |
82 | ############################################################################## |
83 | # Top rules | |
84 | ############################################################################## | |
85 | all: $(TARGET).cma | |
86 | all.opt: $(TARGET).cmxa | |
34e49164 | 87 | |
485bce71 C |
88 | $(TARGET).cma: $(OBJS) |
89 | $(OCAMLC) -a -o $(TARGET).cma $(OBJS) | |
34e49164 | 90 | |
485bce71 C |
91 | $(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa) |
92 | $(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS) | |
34e49164 | 93 | |
485bce71 C |
94 | $(TARGET).top: $(OBJS) $(LIBS) |
95 | $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) | |
34e49164 | 96 | |
34e49164 | 97 | clean:: |
485bce71 | 98 | rm -f $(TARGET).top |
34e49164 C |
99 | |
100 | ||
34e49164 | 101 | |
485bce71 C |
102 | ############################################################################## |
103 | # Pad's rules | |
104 | ############################################################################## | |
34e49164 | 105 | |
485bce71 C |
106 | ############################################################################## |
107 | # Generic rules | |
108 | ############################################################################## | |
34e49164 | 109 | |
34e49164 C |
110 | .SUFFIXES: .ml .mli .cmo .cmi .cmx |
111 | ||
112 | .ml.cmo: | |
113 | $(OCAMLC) -c $< | |
34e49164 C |
114 | .mli.cmi: |
115 | $(OCAMLC) -c $< | |
34e49164 C |
116 | .ml.cmx: |
117 | $(OCAMLOPT) -c $< | |
118 | ||
b1b2de81 | 119 | .ml.mldepend: |
485bce71 | 120 | $(OCAMLC) -i $< |
34e49164 | 121 | |
34e49164 | 122 | clean:: |
485bce71 | 123 | rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot |
485bce71 | 124 | rm -f *~ .*~ gmon.out #*# |
34e49164 | 125 | |
b1b2de81 C |
126 | distclean:: |
127 | rm -f .depend | |
128 | ||
485bce71 | 129 | beforedepend:: |
34e49164 | 130 | |
485bce71 C |
131 | depend:: beforedepend |
132 | $(OCAMLDEP) *.mli *.ml > .depend | |
34e49164 C |
133 | |
134 | -include .depend |