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 | ||
951c7801 C |
25 | #note: if you add a file (a .mli or .ml), dont forget to do a make depend |
26 | ||
27 | -include ../Makefile.config | |
28 | ||
29 | TARGET = popl | |
30 | ||
31 | SRC = ast_popl.ml asttopopl.ml insert_quantifiers.ml insert_befaft.ml \ | |
32 | pretty_print_popl.ml popltoctl.ml popl.ml flag_popl.ml | |
33 | ||
34 | SYSLIBS=str.cma unix.cma | |
35 | LIBS=../commons/commons.cma ../globals/globals.cma | |
36 | ||
37 | INCLUDE_PATH = -I ../commons -I ../globals \ | |
38 | -I ../ctl -I ../parsing_c -I ../parsing_cocci -I ../engine | |
39 | ||
40 | #The Caml compilers. | |
41 | #for warning: -w A | |
42 | #for profiling: -p -inline 0 with OCAMLOPT | |
43 | CAMLC =ocamlc$(OPTBIN) -dtypes -g | |
44 | CAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) | |
45 | CAMLLEX = ocamllex$(OPTBIN) | |
46 | CAMLYACC= ocamlyacc | |
47 | CAMLDEP = ocamldep$(OPTBIN) | |
48 | CAMLMKTOP=ocamlmktop -g -custom | |
49 | ||
50 | ||
51 | ||
52 | LIB=$(TARGET).cma | |
53 | OPTLIB=$(LIB:.cma=.cmxa) | |
54 | ||
55 | OBJS = $(SRC:.ml=.cmo) | |
56 | OPTOBJS = $(SRC:.ml=.cmx) | |
57 | ||
58 | all: $(LIB) | |
59 | all.opt: $(OPTLIB) | |
60 | ||
61 | $(TARGET).top: $(LIB) | |
62 | $(CAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) | |
63 | ||
64 | $(LIB): $(OBJS) | |
65 | $(CAMLC) -a -o $(LIB) $(OBJS) | |
66 | ||
67 | clean:: | |
68 | rm -f $(LIB) $(TARGET).top | |
69 | ||
70 | ||
71 | $(OPTLIB): $(OPTOBJS) | |
72 | $(CAMLOPT) -a -o $(OPTLIB) $(OPTOBJS) | |
73 | ||
74 | # clean rule for LIB.opt | |
75 | clean:: | |
76 | rm -f $(OPTLIB) $(LIB:.cma=.a) | |
77 | ||
78 | ||
79 | .SUFFIXES: | |
80 | .SUFFIXES: .ml .mli .cmo .cmi .cmx | |
81 | ||
82 | .ml.cmo: | |
83 | $(CAMLC) $(INCLUDE_PATH) -c $< | |
84 | ||
85 | .mli.cmi: | |
86 | $(CAMLC) $(INCLUDE_PATH) -c $< | |
87 | ||
88 | .ml.cmx: | |
89 | $(CAMLOPT) $(INCLUDE_PATH) -c $< | |
90 | ||
91 | ||
92 | ||
93 | ||
94 | # clean rule for others files | |
95 | clean:: | |
96 | rm -f *.cm[iox] *.o *.annot | |
97 | rm -f *~ .*~ #*# | |
98 | ||
99 | depend: | |
100 | $(CAMLDEP) $(INCLUDE_PATH) *.mli *.ml > .depend | |
101 | ||
102 | distclean:: | |
103 | rm -f .depend | |
104 | ||
105 | .depend: | |
106 | $(CAMLDEP) $(INCLUDE_PATH) *.mli *.ml > .depend | |
107 | ||
108 | -include .depend |