Release coccinelle-0.2.0rc1
[bpt/coccinelle.git] / python / Makefile
CommitLineData
34e49164
C
1#############################################################################
2# Configuration section
3#############################################################################
4-include ../Makefile.config
5
6##############################################################################
7# Variables
8##############################################################################
9TARGET=coccipython
10
b1b2de81 11SOURCES= pycocci_aux.ml pycocci.ml
34e49164
C
12
13INCLUDEDIRS = ../commons ../commons/ocamlextra ../globals ../pycaml \
14 ../parsing_c ../parsing_cocci
15
16SYSLIBS = str.cma unix.cma
b1b2de81 17LIBS=../commons/commons.cma ../globals/globals.cma
34e49164
C
18
19# ../ctl/ctl.cma \
b1b2de81
C
20# ../parsing_c/c_parser.cma ../parsing_cocci/cocci_parser.cma
21#pycaml/pycaml.cma
34e49164
C
22
23
24##############################################################################
25# Generic variables
26##############################################################################
27
28INCLUDES=$(INCLUDEDIRS:%=-I %) $(INCLUDESEXTRA)
29
30##############################################################################
31# Generic ocaml variables
32##############################################################################
33
34# The Caml compilers.
35OCAMLCFLAGS ?= -g -dtypes
36OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
37OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
0708f913 38OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES)
34e49164
C
39
40
41##############################################################################
42# Top rules
43##############################################################################
44
45EXEC=$(TARGET).byte
46LIB=$(TARGET).cma
47OPTLIB=$(LIB:.cma=.cmxa)
48
49CTLEXEC=$(CTLTARGET)
50
51OBJS = $(SOURCES:.ml=.cmo)
52OPTOBJS = $(OBJS:.cmo=.cmx)
53
54CTLOBJS = $(CTLSOURCES:.ml=.cmo)
55CTLOPTOBJS = $(CTLOBJS:.cmo=.cmx)
56
57
58#all: $(EXEC) $(LIB)
59all: $(LIB)
60
61all.opt: $(OPTLIB)
62
63ctl: $(CTLEXEC)
64
65
66$(LIB): $(OBJS)
67 $(OCAMLC) -a -o $(LIB) $(OBJS)
68
69clean::
70 rm -f $(LIB)
71
72
b1b2de81 73$(OPTLIB): $(OPTOBJS)
34e49164
C
74 $(OCAMLOPT) -a -o $(OPTLIB) $(OPTOBJS)
75
76
77$(EXEC): $(OBJS) main.cmo $(LIBS)
78 $(OCAMLC) -o $(EXEC) $(SYSLIBS) $(LIBS) $(OBJS) main.cmo
79
80$(CTLEXEC): $(CTLOBJS) $(LIBS)
81 $(OCAMLC) -o $(CTLEXEC) $(SYSLIBS) $(LIBS) $(CTLOBJS)
82
83
84clean::
b1b2de81 85 rm -f $(OPTLIB) $(LIB:.cma=.a)
34e49164
C
86 rm -f $(TARGET) rm -f $(TARGET).byte
87 rm -f $(CTLTARGET)
88
89
90#pycocci.ml: ../pycaml/pycaml.ml ../pycaml/pycaml_ml.c
91#pycocci_aux.ml: ../pycaml/pycaml.ml ../pycaml/pycaml_ml.c
b1b2de81
C
92pycocci_aux.ml:
93 @echo "\n\n\t*** pycocci_aux.ml not found ! ***\n\n\tRun 'configure && make depend' first.\n\n"
34e49164
C
94
95rmlinks:
96 rm -f pycocci.ml pycocci_aux.ml
97
98##############################################################################
99# Generic ocaml rules
100##############################################################################
101
102.SUFFIXES:
103.SUFFIXES: .ml .mli .cmo .cmi .cmx
104
105.ml.cmo:
106 $(OCAMLC) -c $<
107
108.mli.cmi:
109 $(OCAMLC) -c $<
110
111.ml.cmx:
112 $(OCAMLOPT) -c $<
113
114
115# clean rule for others files
116clean::
117 rm -f *.cm[iox] *.o *.annot
b1b2de81
C
118 rm -f *~ .*~ #*#
119
120distclean::
121 rm -f .depend
34e49164
C
122
123beforedepend:
124
125depend: beforedepend
126 $(OCAMLDEP) *.mli *.ml > .depend
127
b1b2de81 128.depend:
34e49164
C
129 $(OCAMLDEP) *.mli *.ml > .depend
130
131-include .depend