- Try to do better pretty printing when array elements are individually
[bpt/coccinelle.git] / engine / 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
485bce71
C
25##############################################################################
26# Variables
27##############################################################################
28#TARGET=matcher
feec80c3
C
29ifneq ($(MAKECMDGOALS),distclean)
30include ../Makefile.config
31endif
0708f913 32
34e49164
C
33TARGET=cocciengine
34CTLTARGET=engine
35
755320b0
C
36SRC= externalanalysis.ml \
37 flag_matcher.ml lib_engine.ml pretty_print_engine.ml \
485bce71
C
38 check_exhaustive_pattern.ml \
39 check_reachability.ml \
40 c_vs_c.ml isomorphisms_c_c.ml \
8babbc8f 41 cocci_vs_c.ml pattern_c.ml transformation_c.ml \
485bce71 42 asttomember.ml asttoctl2.ml ctltotex.ml \
0708f913 43 postprocess_transinfo.ml ctlcocci_integration.ml
485bce71 44
485bce71 45INCLUDES = -I ../commons -I ../commons/ocamlextra -I ../globals \
b1b2de81 46 -I ../ctl -I ../parsing_cocci -I ../parsing_c
485bce71
C
47LIBS=../commons/commons.cma ../globals/globals.cma \
48 ../ctl/ctl.cma ../parsing_c/parsing_c.cma ../parsing_cocci/cocci_parser.cma
49
b1b2de81 50SYSLIBS= str.cma unix.cma
485bce71 51
34e49164
C
52
53# just to test asttoctl
54# CTLSOURCES = lib_engine.ml pretty_print_engine.ml asttoctl.ml ctltotex.ml \
55# main.ml
56
485bce71
C
57##############################################################################
58# Generic variables
59##############################################################################
34e49164 60
b1b2de81 61#for warning: -w A
485bce71 62#for profiling: -p -inline 0 with OCAMLOPT
755320b0
C
63OCAMLCFLAGS ?= -g
64OPTFLAGS ?= -g
34e49164 65
755320b0
C
66OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
67OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
feec80c3
C
68OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDESDEP)
69OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES)
34e49164 70
485bce71
C
71OBJS = $(SRC:.ml=.cmo)
72OPTOBJS = $(SRC:.ml=.cmx)
34e49164 73
34e49164 74
485bce71
C
75##############################################################################
76# Top rules
77##############################################################################
abad11c5 78ifneq ($(FEATURE_OCAMLBUILD),yes)
485bce71 79all: $(TARGET).cma
d6ce1786
C
80all.opt:
81 @$(MAKE) $(TARGET).cmxa BUILD_OPT=yes
34e49164 82
485bce71 83$(TARGET).cma: $(OBJS)
feec80c3 84 $(OCAMLC_CMD) -a -o $(TARGET).cma $(OBJS)
34e49164 85
485bce71 86$(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
feec80c3 87 $(OCAMLOPT_CMD) -a -o $(TARGET).cmxa $(OPTOBJS)
34e49164 88
485bce71 89$(TARGET).top: $(OBJS) $(LIBS)
feec80c3 90 $(OCAMLMKTOP_CMD) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
34e49164 91
34e49164 92clean::
485bce71 93 rm -f $(TARGET).top
abad11c5
C
94else
95all:
96 cd .. && $(OCAMLBUILD) engine/engine.cma
34e49164 97
abad11c5
C
98all.opt:
99 cd .. && $(OCAMLBUILD) engine/engine.cmxa
100
101clean::
102 cd .. && $(OCAMLBUILD) -clean
103endif
34e49164 104
34e49164 105
485bce71
C
106##############################################################################
107# Pad's rules
108##############################################################################
34e49164 109
485bce71
C
110##############################################################################
111# Generic rules
112##############################################################################
34e49164 113
34e49164
C
114.SUFFIXES: .ml .mli .cmo .cmi .cmx
115
116.ml.cmo:
feec80c3 117 $(OCAMLC_CMD) -c $<
34e49164 118.mli.cmi:
feec80c3 119 $(OCAMLC_CMD) -c $<
34e49164 120.ml.cmx:
feec80c3 121 $(OCAMLOPT_CMD) -c $<
34e49164 122
b1b2de81 123.ml.mldepend:
feec80c3 124 $(OCAMLC_CMD) -i $<
34e49164 125
34e49164 126clean::
485bce71 127 rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
485bce71 128 rm -f *~ .*~ gmon.out #*#
b1b2de81
C
129 rm -f .depend
130
feec80c3 131distclean: clean
34e49164 132
feec80c3
C
133.PHONEY: depend
134.depend depend:
135 $(OCAMLDEP_CMD) *.mli *.ml > .depend
34e49164 136
feec80c3
C
137ifneq ($(MAKECMDGOALS),clean)
138ifneq ($(MAKECMDGOALS),distclean)
abad11c5 139ifneq ($(FEATURE_OCAMLBUILD),yes)
34e49164 140-include .depend
feec80c3
C
141endif
142endif
abad11c5 143endif
d6ce1786
C
144
145include ../Makefile.common