permit multiline comments and strings in macros
[bpt/coccinelle.git] / popl / Makefile
CommitLineData
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
feec80c3
C
27ifneq ($(MAKECMDGOALS),distclean)
28include ../Makefile.config
29endif
951c7801
C
30
31TARGET = popl
32
755320b0
C
33OCAMLCFLAGS ?= -g
34OPTFLAGS ?= -g
d6ce1786 35
951c7801
C
36SRC = ast_popl.ml asttopopl.ml insert_quantifiers.ml insert_befaft.ml \
37pretty_print_popl.ml popltoctl.ml popl.ml flag_popl.ml
38
39SYSLIBS=str.cma unix.cma
40LIBS=../commons/commons.cma ../globals/globals.cma
41
42INCLUDE_PATH = -I ../commons -I ../globals \
43 -I ../ctl -I ../parsing_c -I ../parsing_cocci -I ../engine
44
45#The Caml compilers.
46#for warning: -w A
47#for profiling: -p -inline 0 with OCAMLOPT
755320b0
C
48OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS)
49OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS)
feec80c3
C
50OCAMLDEP_CMD=$(OCAMLDEP)
51OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom
951c7801 52
951c7801
C
53LIB=$(TARGET).cma
54OPTLIB=$(LIB:.cma=.cmxa)
55
56OBJS = $(SRC:.ml=.cmo)
57OPTOBJS = $(SRC:.ml=.cmx)
58
59all: $(LIB)
d6ce1786
C
60all.opt:
61 @$(MAKE) $(OPTLIB) BUILD_OPT=yes
951c7801
C
62
63$(TARGET).top: $(LIB)
d6ce1786 64 $(OCAMLMKTOP_CMD) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
951c7801
C
65
66$(LIB): $(OBJS)
d6ce1786 67 $(OCAMLC_CMD) -a -o $(LIB) $(OBJS)
951c7801
C
68
69clean::
70 rm -f $(LIB) $(TARGET).top
71
72
73$(OPTLIB): $(OPTOBJS)
d6ce1786 74 $(OCAMLOPT_CMD) -a -o $(OPTLIB) $(OPTOBJS)
951c7801
C
75
76# clean rule for LIB.opt
77clean::
78 rm -f $(OPTLIB) $(LIB:.cma=.a)
79
80
81.SUFFIXES:
82.SUFFIXES: .ml .mli .cmo .cmi .cmx
83
84.ml.cmo:
d6ce1786 85 $(OCAMLC_CMD) $(INCLUDE_PATH) -c $<
951c7801
C
86
87.mli.cmi:
d6ce1786 88 $(OCAMLC_CMD) $(INCLUDE_PATH) -c $<
951c7801
C
89
90.ml.cmx:
d6ce1786 91 $(OCAMLOPT_CMD) $(INCLUDE_PATH) -c $<
951c7801
C
92
93
94# clean rule for others files
95clean::
96 rm -f *.cm[iox] *.o *.annot
97 rm -f *~ .*~ #*#
951c7801
C
98 rm -f .depend
99
feec80c3
C
100distclean: clean
101
102.PHONEY: depend
103.depend depend:
d6ce1786 104 $(OCAMLDEP_CMD) $(INCLUDE_PATH) *.mli *.ml > .depend
951c7801 105
feec80c3
C
106ifneq ($(MAKECMDGOALS),clean)
107ifneq ($(MAKECMDGOALS),distclean)
abad11c5 108ifneq ($(FEATURE_OCAMLBUILD),yes)
951c7801 109-include .depend
feec80c3
C
110endif
111endif
abad11c5 112endif
d6ce1786
C
113
114include ../Makefile.common