Release coccinelle-0.2.0rc1
[bpt/coccinelle.git] / popl09 / 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 TARGET = popl
5
6 SRC = ast_popl.ml asttopopl.ml insert_quantifiers.ml \
7 pretty_print_popl.ml flag_popl.ml popltoctl.ml popl.ml
8
9 SYSLIBS=str.cma unix.cma
10 LIBS=../commons/commons.cma ../globals/globals.cma
11
12 INCLUDES = -I ../commons -I ../globals \
13 -I ../ctl -I ../parsing_cocci -I ../parsing_c -I ../engine
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
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)
36 $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
37
38 $(LIB): $(OBJS)
39 $(OCAMLC) -a -o $(LIB) $(OBJS)
40
41 clean::
42 rm -f $(LIB) $(TARGET).top
43
44
45 $(OPTLIB): $(OPTOBJS)
46 $(OCAMLOPT) -a -o $(OPTLIB) $(OPTOBJS)
47
48 # clean rule for LIB.opt
49 clean::
50 rm -f $(OPTLIB) $(LIB:.cma=.a)
51
52
53 .SUFFIXES:
54 .SUFFIXES: .ml .mli .cmo .cmi .cmx
55
56 .ml.cmo:
57 $(OCAMLC) -c $<
58
59 .mli.cmi:
60 $(OCAMLC) -c $<
61
62 .ml.cmx:
63 $(OCAMLOPT) -c $<
64
65
66
67
68 # clean rule for others files
69 clean::
70 rm -f *.cm[iox] *.o *.annot
71 rm -f *~ .*~ #*#
72
73 depend:
74 $(OCAMLDEP) *.mli *.ml > .depend
75
76 distclean::
77 rm -f .depend
78
79 .depend:
80 $(OCAMLDEP) $(INCLUDE_PATH) *.mli *.ml > .depend
81
82 -include .depend