1 ##############################################################################
3 ##############################################################################
5 -include ..
/Makefile.config
10 SRC
=coccilib.ml ocamlcocci_aux.ml prepare_ocamlcocci.ml run_ocamlcocci.ml
12 #LIBS=../commons/commons.cma ../parsing_c/parsing_c.cma
13 #INCLUDES= -I ../commons -I ../parsing_c
14 INCLUDES
= -I ..
/commons
-I ..
/commons
/ocamlextra
-I ..
/globals \
15 -I ..
/parsing_cocci
-I ..
/parsing_c
16 LIBS
=..
/commons
/commons.cma ..
/globals
/globals.cma \
17 ..
/parsing_c
/parsing_c.cma ..
/parsing_cocci
/cocci_parser.cma
19 SYSLIBS
= str.cma unix.cma
21 ##############################################################################
23 ##############################################################################
26 #for profiling: -p -inline 0 with OCAMLOPT
27 OCAMLCFLAGS ?
= -g
-dtypes
28 OPTFLAGS?
=$(OCAMLCFLAGS
)
30 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
31 OCAMLOPT
=ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
32 OCAMLLEX
=ocamllex
$(OPTBIN
) #-ml
33 OCAMLYACC
=ocamlyacc
-v
34 OCAMLDEP
=ocamldep
$(OPTBIN
) $(INCLUDES
)
35 OCAMLMKTOP
=ocamlmktop
-g
-custom
$(INCLUDES
)
38 OBJS
= $(SRC
:.ml
=.cmo
)
39 OPTOBJS
= $(SRC
:.ml
=.cmx
)
42 ##############################################################################
44 ##############################################################################
46 all.opt
: $(TARGET
).cmxa
48 $(TARGET
).cma
: $(OBJS
)
49 $(OCAMLC
) -a
-o
$(TARGET
).cma
$(OBJS
)
51 $(TARGET
).cmxa
: $(OPTOBJS
) $(LIBS
:.cma
=.cmxa
)
52 $(OCAMLOPT
) -a
-o
$(TARGET
).cmxa
$(OPTOBJS
)
54 $(TARGET
).top
: $(OBJS
) $(LIBS
)
55 $(OCAMLMKTOP
) -o
$(TARGET
).top
$(SYSLIBS
) $(LIBS
) $(OBJS
)
62 ##############################################################################
64 ##############################################################################
66 ##############################################################################
68 ##############################################################################
70 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
83 rm -f
*.cm
[ioxa
] *.o
*.a
*.cmxa
*.annot
84 rm -f
*~ .
*~ gmon.out
#*#
92 $(OCAMLDEP
) *.mli
*.ml
> .depend