Commit | Line | Data |
---|---|---|
f537ebc4 C |
1 | # Copyright 2010, INRIA, University of Copenhagen |
2 | # Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix | |
3 | # Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen | |
4 | # Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix | |
5 | # This file is part of Coccinelle. | |
6 | # | |
7 | # Coccinelle is free software: you can redistribute it and/or modify | |
8 | # it under the terms of the GNU General Public License as published by | |
9 | # the Free Software Foundation, according to version 2 of the License. | |
10 | # | |
11 | # Coccinelle is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with Coccinelle. If not, see <http://www.gnu.org/licenses/>. | |
18 | # | |
19 | # The authors reserve the right to distribute this or future versions of | |
20 | # Coccinelle under other licenses. | |
21 | ||
22 | ||
951c7801 C |
23 | #note: if you add a file (a .mli or .ml), dont forget to do a make depend |
24 | ||
25 | -include ../Makefile.config | |
26 | TARGET = popl | |
27 | ||
28 | SRC = ast_popl.ml asttopopl.ml insert_quantifiers.ml \ | |
29 | pretty_print_popl.ml flag_popl.ml popltoctl.ml popl.ml | |
30 | ||
31 | SYSLIBS=str.cma unix.cma | |
32 | LIBS=../commons/commons.cma ../globals/globals.cma | |
33 | ||
34 | INCLUDES = -I ../commons -I ../globals \ | |
35 | -I ../ctl -I ../parsing_cocci -I ../parsing_c -I ../engine | |
36 | ||
37 | #The Caml compilers. | |
38 | #for warning: -w A | |
39 | #for profiling: -p -inline 0 with OCAMLOPT | |
40 | OCAMLCFLAGS ?= -g -dtypes | |
41 | OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES) | |
42 | OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES) | |
43 | OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES) | |
44 | OCAMLMKTOP=ocamlmktop -g -custom | |
45 | ||
46 | ||
47 | ||
48 | LIB=$(TARGET).cma | |
49 | OPTLIB=$(LIB:.cma=.cmxa) | |
50 | ||
51 | OBJS = $(SRC:.ml=.cmo) | |
52 | OPTOBJS = $(SRC:.ml=.cmx) | |
53 | ||
54 | all: $(LIB) | |
55 | all.opt: $(OPTLIB) | |
56 | ||
57 | $(TARGET).top: $(LIB) | |
58 | $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) | |
59 | ||
60 | $(LIB): $(OBJS) | |
61 | $(OCAMLC) -a -o $(LIB) $(OBJS) | |
62 | ||
63 | clean:: | |
64 | rm -f $(LIB) $(TARGET).top | |
65 | ||
66 | ||
67 | $(OPTLIB): $(OPTOBJS) | |
68 | $(OCAMLOPT) -a -o $(OPTLIB) $(OPTOBJS) | |
69 | ||
70 | # clean rule for LIB.opt | |
71 | clean:: | |
72 | rm -f $(OPTLIB) $(LIB:.cma=.a) | |
73 | ||
74 | ||
75 | .SUFFIXES: | |
76 | .SUFFIXES: .ml .mli .cmo .cmi .cmx | |
77 | ||
78 | .ml.cmo: | |
79 | $(OCAMLC) -c $< | |
80 | ||
81 | .mli.cmi: | |
82 | $(OCAMLC) -c $< | |
83 | ||
84 | .ml.cmx: | |
85 | $(OCAMLOPT) -c $< | |
86 | ||
87 | ||
88 | ||
89 | ||
90 | # clean rule for others files | |
91 | clean:: | |
92 | rm -f *.cm[iox] *.o *.annot | |
93 | rm -f *~ .*~ #*# | |
94 | ||
95 | depend: | |
96 | $(OCAMLDEP) *.mli *.ml > .depend | |
97 | ||
98 | distclean:: | |
99 | rm -f .depend | |
100 | ||
101 | .depend: | |
102 | $(OCAMLDEP) $(INCLUDE_PATH) *.mli *.ml > .depend | |
103 | ||
104 | -include .depend |