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 \
26 visitor_c.ml lib_parsing_c.ml \
27 control_flow_c_build.ml \
29 semantic_c.ml lexer_parser.ml parser_c.ml lexer_c.ml \
30 token_helpers.ml token_views_c.ml \
34 unparse_cocci.ml unparse_c.ml unparse_hrule.ml \
35 parsing_recovery_c.ml parsing_consistency_c.ml \
36 parse_c.ml type_c.ml \
38 type_annoter_c.ml comment_annotater_c.ml \
44 # ast_cocci.ml and unparse_cocci.ml should be deleted in the futur
45 # to make parsing_c really independent of coccinelle.
46 # control_flow_c have also coccinelle dependencies.
47 # old: parsing_c now depends on cocci_parser because in addition to decorate
48 # the token in Ast_c with some parse info, we now also make some place to
49 # welcome some mcodekind of Ast_cocci.
50 LIBS
=..
/commons
/commons.cma ..
/globals
/globals.cma \
51 ..
/parsing_cocci
/cocci_parser.cma
53 INCLUDESDEP
= -I ..
/commons
-I ..
/commons
/ocamlextra
-I ..
/commons
/ocollection \
54 -I ..
/globals
-I ..
/parsing_cocci
56 INCLUDES
=$(INCLUDESDEP
) $(TARZANINCLUDE
)
58 #LIBS=../commons/commons.cma
59 #INCLUDES= -I ../commons
60 SYSLIBS
= str.cma unix.cma num.cma
62 ##############################################################################
64 ##############################################################################
67 #for profiling: -p -inline 0 with OCAMLOPT
68 OCAMLCFLAGS ?
= -g
-dtypes
70 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
71 OCAMLOPT
=ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
72 OCAMLLEX
=ocamllex
$(OPTBIN
) #-ml
73 OCAMLYACC
=ocamlyacc
-v
74 OCAMLDEP
=ocamldep
$(OPTBIN
) $(INCLUDESDEP
)
75 OCAMLMKTOP
=ocamlmktop
-g
-custom
$(INCLUDES
)
78 OBJS
= $(SRC
:.ml
=.cmo
)
79 OPTOBJS
= $(SRC
:.ml
=.cmx
)
82 ##############################################################################
84 ##############################################################################
86 all.opt
: $(TARGET
).cmxa
88 $(TARGET
).cma
: $(OBJS
)
89 $(OCAMLC
) -a
-o
$(TARGET
).cma
$(OBJS
)
91 $(TARGET
).cmxa
: $(OPTOBJS
) $(LIBS
:.cma
=.cmxa
)
92 $(OCAMLOPT
) -a
-o
$(TARGET
).cmxa
$(OPTOBJS
)
94 $(TARGET
).top
: $(OBJS
) $(LIBS
)
95 $(OCAMLMKTOP
) -o
$(TARGET
).top
$(SYSLIBS
) $(LIBS
) $(OBJS
)
100 lexer_c.ml
: lexer_c.mll
104 beforedepend
:: lexer_c.ml
107 parser_c.ml parser_c.mli
: parser_c.mly
110 rm -f parser_c.ml parser_c.mli parser_c.output
111 beforedepend
:: parser_c.ml parser_c.mli
114 ##############################################################################
116 ##############################################################################
117 # visitor_c.ml lib_parsing_c.ml \
118 # type_annoter_c.ml \
120 # pretty_print_c.ml unparse_c.ml \
122 #toreput: compare_c.ml ast_to_flow.ml
124 COREPARSING
= flag_parsing_c.ml parsing_stat.ml \
126 ast_c.ml control_flow_c.ml \
127 semantic_c.ml lexer_parser.ml parser_c.mly lexer_c.mll \
128 token_helpers.ml parsing_hacks.ml parse_c.ml \
136 wc
-l parsing_hacks.ml
140 ##############################################################################
141 # Literate Programming rules
142 ##############################################################################
145 ##############################################################################
147 ##############################################################################
149 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
162 rm -f
*.cm
[ioxa
] *.o
*.a
*.cmxa
*.annot
163 rm -f
*~ .
*~ gmon.out
#*#
173 depend
:: beforedepend
174 $(OCAMLDEP
) *.mli
*.ml
> .depend