Release coccinelle-0.2.0rc1
[bpt/coccinelle.git] / ctl / Makefile
1 #note: if you add a file (a .mli or .ml), dont forget to do a make depend
2
3 -include ../Makefile.config
4
5 TARGET=ctl
6
7 SRC=flag_ctl.ml ast_ctl.ml pretty_print_ctl.ml ctl_engine.ml wrapper_ctl.ml
8
9 SYSLIBS=str.cma unix.cma
10 LIBS=../commons/commons.cma ../globals/globals.cma
11
12 INCLUDES=-I ../commons -I ../commons/ocamlextra -I ../globals
13
14
15 #The Caml compilers.
16 #for warning: -w A
17 #for profiling: -p -inline 0 with OCAMLOPT
18 OCAMLCFLAGS ?= -g -dtypes
19 OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
20 OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
21 OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES)
22 OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
23
24
25
26 LIB=$(TARGET).cma
27 OPTLIB=$(LIB:.cma=.cmxa)
28
29 OBJS = $(SRC:.ml=.cmo)
30 OPTOBJS = $(SRC:.ml=.cmx)
31
32 all: $(LIB)
33 all.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
44 clean::
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
64 clean::
65 rm -f *.cm[iox] *.o *.annot
66 rm -f *~ .*~ #*#
67
68 depend:
69 $(OCAMLDEP) *.mli *.ml > .depend
70
71 distclean::
72 rm -f .depend
73
74 .depend:
75 $(OCAMLDEP) *.mli *.ml > .depend
76
77 -include .depend