Release coccinelle-0.2.0rc1
[bpt/coccinelle.git] / ctl / Makefile
CommitLineData
34e49164
C
1#note: if you add a file (a .mli or .ml), dont forget to do a make depend
2
0708f913
C
3-include ../Makefile.config
4
34e49164
C
5TARGET=ctl
6
7SRC=flag_ctl.ml ast_ctl.ml pretty_print_ctl.ml ctl_engine.ml wrapper_ctl.ml
8
9SYSLIBS=str.cma unix.cma
10LIBS=../commons/commons.cma ../globals/globals.cma
11
12INCLUDES=-I ../commons -I ../commons/ocamlextra -I ../globals
13
14
15#The Caml compilers.
b1b2de81 16#for warning: -w A
34e49164
C
17#for profiling: -p -inline 0 with OCAMLOPT
18OCAMLCFLAGS ?= -g -dtypes
19OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
20OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
0708f913 21OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES)
34e49164
C
22OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
23
24
25
26LIB=$(TARGET).cma
27OPTLIB=$(LIB:.cma=.cmxa)
28
29OBJS = $(SRC:.ml=.cmo)
30OPTOBJS = $(SRC:.ml=.cmx)
31
32all: $(LIB)
33all.opt: $(OPTLIB)
34
35$(TARGET).top: $(LIB) test_ctl.cmo
36 $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) test_ctl.cmo
37
38$(LIB): $(OBJS)
39 $(OCAMLC) -a -o $(LIB) $(OBJS)
40
41$(OPTLIB): $(OPTOBJS)
42 $(OCAMLOPT) -a -o $(OPTLIB) $(OPTOBJS)
43
44clean::
45 rm -f $(LIB) $(OPTLIB) $(LIB:.cma=.a) $(TARGET).top
46
47
48.SUFFIXES:
49.SUFFIXES: .ml .mli .cmo .cmi .cmx
50
51.ml.cmo:
52 $(OCAMLC) -c $<
53
54.mli.cmi:
55 $(OCAMLC) -c $<
56
57.ml.cmx:
58 $(OCAMLOPT) -c $<
59
60
61
62
63# clean rule for others files
64clean::
65 rm -f *.cm[iox] *.o *.annot
b1b2de81 66 rm -f *~ .*~ #*#
34e49164 67
b1b2de81 68depend:
34e49164
C
69 $(OCAMLDEP) *.mli *.ml > .depend
70
71distclean::
72 rm -f .depend
73
74.depend:
75 $(OCAMLDEP) *.mli *.ml > .depend
76
77-include .depend