1 ##############################################################################
3 ##############################################################################
7 # - type_cocci.ml ast_cocci.ml # + unparse_hrule
8 SRC
= flag_parsing_c.ml parsing_stat.ml \
9 ast_c.ml control_flow_c.ml \
10 visitor_c.ml lib_parsing_c.ml \
13 semantic_c.ml lexer_parser.ml parser_c.ml lexer_c.ml \
14 token_helpers.ml parsing_hacks.ml \
15 unparse_cocci.ml unparse_c.ml unparse_hrule.ml \
18 compare_c.ml type_annoter_c.ml \
23 # ast_cocci.ml and unparse_cocci.ml should be deleted in the futur
24 # to make parsing_c really independent of coccinelle.
25 # control_flow_c have also coccinelle dependencies.
26 # old: parsing_c now depends on cocci_parser because in addition to decorate
27 # the token in Ast_c with some parse info, we now also make some place to
28 # welcome some mcodekind of Ast_cocci.
29 LIBS
=..
/commons
/commons.cma ..
/globals
/globals.cma \
30 ..
/parsing_cocci
/cocci_parser.cma
32 INCLUDES
= -I ..
/commons
-I ..
/globals
-I ..
/parsing_cocci
34 #LIBS=../commons/commons.cma
35 #INCLUDES= -I ../commons
36 SYSLIBS
= str.cma unix.cma
38 ##############################################################################
40 ##############################################################################
43 #for profiling: -p -inline 0 with OCAMLOPT
44 OCAMLCFLAGS ?
= -g
-dtypes
46 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
47 OCAMLOPT
=ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
48 OCAMLLEX
=ocamllex
$(OPTBIN
) #-ml
49 OCAMLYACC
=ocamlyacc
-v
50 OCAMLDEP
=ocamldep
$(OPTBIN
) $(INCLUDES
)
51 OCAMLMKTOP
=ocamlmktop
-g
-custom
$(INCLUDES
)
54 OBJS
= $(SRC
:.ml
=.cmo
)
55 OPTOBJS
= $(SRC
:.ml
=.cmx
)
58 ##############################################################################
60 ##############################################################################
62 all.opt
: $(TARGET
).cmxa
64 $(TARGET
).cma
: $(OBJS
)
65 $(OCAMLC
) -a
-o
$(TARGET
).cma
$(OBJS
)
67 $(TARGET
).cmxa
: $(OPTOBJS
) $(LIBS
:.cma
=.cmxa
)
68 $(OCAMLOPT
) -a
-o
$(TARGET
).cmxa
$(OPTOBJS
)
70 $(TARGET
).top
: $(OBJS
) $(LIBS
)
71 $(OCAMLMKTOP
) -o
$(TARGET
).top
$(SYSLIBS
) $(LIBS
) $(OBJS
)
78 lexer_c.ml
: lexer_c.mll
82 beforedepend
:: lexer_c.ml
85 parser_c.ml parser_c.mli
: parser_c.mly
88 rm -f parser_c.ml parser_c.mli parser_c.output
89 beforedepend
:: parser_c.ml parser_c.mli
92 ##############################################################################
94 ##############################################################################
95 # visitor_c.ml lib_parsing_c.ml \
98 # pretty_print_c.ml unparse_c.ml \
100 #toreput: compare_c.ml ast_to_flow.ml
102 COREPARSING
= flag_parsing_c.ml parsing_stat.ml \
104 ast_c.ml control_flow_c.ml \
105 semantic_c.ml lexer_parser.ml parser_c.mly lexer_c.mll \
106 token_helpers.ml parsing_hacks.ml parse_c.ml \
114 wc
-l parsing_hacks.ml
119 ##############################################################################
121 ##############################################################################
123 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
136 rm -f
*.cm
[ioxa
] *.o
*.a
*.cmxa
*.annot
138 rm -f
*~ .
*~ gmon.out
#*#
142 depend
:: beforedepend
143 $(OCAMLDEP
) *.mli
*.ml
> .depend