2 -include ..
/Makefile.config
4 ##############################################################################
6 ##############################################################################
9 -include ..
/Makefile.config
11 # ifeq ($(FEATURE_TARZAN), 1)
12 # TARZANSRC=sexp_ast_c.ml
13 # ifeq ("$(SEXPDIR)","ocamlsexp")
14 # TARZANINCLUDE=-I ../$(SEXPDIR)
16 # TARZANINCLUDE=-I $(SEXPDIR)
17 # endif # Use local ocamlsexp
18 # endif # FEATURE_TARZAN
22 # - type_cocci.ml ast_cocci.ml # + unparse_hrule
23 SRC
= flag_parsing_c.ml parsing_stat.ml \
24 token_c.ml ast_c.ml control_flow_c.ml \
25 visitor_c.ml lib_parsing_c.ml \
26 control_flow_c_build.ml \
28 semantic_c.ml lexer_parser.ml parser_c.ml lexer_c.ml \
29 token_helpers.ml token_views_c.ml \
33 unparse_cocci.ml unparse_c.ml unparse_hrule.ml \
34 parsing_recovery_c.ml parsing_consistency_c.ml \
35 parse_c.ml type_c.ml \
37 type_annoter_c.ml comment_annotater_c.ml \
43 # ast_cocci.ml and unparse_cocci.ml should be deleted in the futur
44 # to make parsing_c really independent of coccinelle.
45 # control_flow_c have also coccinelle dependencies.
46 # old: parsing_c now depends on cocci_parser because in addition to decorate
47 # the token in Ast_c with some parse info, we now also make some place to
48 # welcome some mcodekind of Ast_cocci.
49 LIBS
=..
/commons
/commons.cma ..
/globals
/globals.cma \
50 ..
/parsing_cocci
/cocci_parser.cma
52 INCLUDESDEP
= -I ..
/commons
-I ..
/commons
/ocamlextra
-I ..
/commons
/ocollection \
53 -I ..
/globals
-I ..
/parsing_cocci
55 INCLUDES
=$(INCLUDESDEP
) $(TARZANINCLUDE
)
57 #LIBS=../commons/commons.cma
58 #INCLUDES= -I ../commons
59 SYSLIBS
= str.cma unix.cma num.cma
61 ##############################################################################
63 ##############################################################################
66 #for profiling: -p -inline 0 with OCAMLOPT
67 OCAMLCFLAGS ?
= -g
-dtypes
69 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
70 OCAMLOPT
=ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
71 OCAMLLEX
=ocamllex
$(OPTBIN
) #-ml
72 OCAMLYACC
=ocamlyacc
-v
73 OCAMLDEP
=ocamldep
$(OPTBIN
) $(INCLUDESDEP
)
74 OCAMLMKTOP
=ocamlmktop
-g
-custom
$(INCLUDES
)
77 OBJS
= $(SRC
:.ml
=.cmo
)
78 OPTOBJS
= $(SRC
:.ml
=.cmx
)
81 ##############################################################################
83 ##############################################################################
85 all.opt
: $(TARGET
).cmxa
87 $(TARGET
).cma
: $(OBJS
)
88 $(OCAMLC
) -a
-o
$(TARGET
).cma
$(OBJS
)
90 $(TARGET
).cmxa
: $(OPTOBJS
) $(LIBS
:.cma
=.cmxa
)
91 $(OCAMLOPT
) -a
-o
$(TARGET
).cmxa
$(OPTOBJS
)
93 $(TARGET
).top
: $(OBJS
) $(LIBS
)
94 $(OCAMLMKTOP
) -o
$(TARGET
).top
$(SYSLIBS
) $(LIBS
) $(OBJS
)
99 lexer_c.ml
: lexer_c.mll
103 beforedepend
:: lexer_c.ml
106 parser_c.ml parser_c.mli
: parser_c.mly
109 rm -f parser_c.ml parser_c.mli parser_c.output
110 beforedepend
:: parser_c.ml parser_c.mli
113 ##############################################################################
115 ##############################################################################
116 # visitor_c.ml lib_parsing_c.ml \
117 # type_annoter_c.ml \
119 # pretty_print_c.ml unparse_c.ml \
121 #toreput: compare_c.ml ast_to_flow.ml
123 COREPARSING
= flag_parsing_c.ml parsing_stat.ml \
125 ast_c.ml control_flow_c.ml \
126 semantic_c.ml lexer_parser.ml parser_c.mly lexer_c.mll \
127 token_helpers.ml parsing_hacks.ml parse_c.ml \
135 wc
-l parsing_hacks.ml
139 ##############################################################################
140 # Literate Programming rules
141 ##############################################################################
144 ##############################################################################
146 ##############################################################################
148 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
161 rm -f
*.cm
[ioxa
] *.o
*.a
*.cmxa
*.annot
162 rm -f
*~ .
*~ gmon.out
#*#
172 depend
:: beforedepend
173 $(OCAMLDEP
) *.mli
*.ml
> .depend