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