1 ifneq ($(MAKECMDGOALS
),distclean)
2 include ..
/Makefile.config
5 ##############################################################################
7 ##############################################################################
10 # - type_cocci.ml ast_cocci.ml # + unparse_hrule
11 SRC
= token_annot.ml flag_parsing_c.ml parsing_stat.ml \
12 token_c.ml ast_c.ml control_flow_c.ml \
13 visitor_c.ml lib_parsing_c.ml \
14 control_flow_c_build.ml \
16 semantic_c.ml lexer_parser.ml parser_c.ml lexer_c.ml \
17 token_helpers.ml token_views_c.ml \
21 unparse_cocci.ml unparse_c.ml unparse_hrule.ml \
22 parsing_recovery_c.ml parsing_consistency_c.ml \
23 parse_c.ml type_c.ml \
25 type_annoter_c.ml comment_annotater_c.ml \
31 # ast_cocci.ml and unparse_cocci.ml should be deleted in the future
32 # to make parsing_c really independent of coccinelle.
33 # control_flow_c have also coccinelle dependencies.
34 # old: parsing_c now depends on cocci_parser because in addition to decorate
35 # the token in Ast_c with some parse info, we now also make some place to
36 # welcome some mcodekind of Ast_cocci.
37 LIBS
=..
/commons
/commons.cma ..
/globals
/globals.cma \
38 ..
/parsing_cocci
/cocci_parser.cma
40 INCLUDESDEP
= -I ..
/commons
-I ..
/commons
/ocamlextra
-I ..
/commons
/ocollection \
41 -I ..
/globals
-I ..
/parsing_cocci
43 INCLUDES
=$(INCLUDESDEP
) $(TARZANINCLUDE
)
45 SYSLIBS
= str.cma unix.cma num.cma
47 ##############################################################################
49 ##############################################################################
52 #for profiling: -p -inline 0 with OCAMLOPT
56 OCAMLC_CMD
=$(OCAMLC
) $(OCAMLCFLAGS
) $(INCLUDES
)
57 OCAMLOPT_CMD
=$(OCAMLOPT
) $(OPTFLAGS
) $(INCLUDES
)
58 OCAMLDEP_CMD
=$(OCAMLDEP
) $(INCLUDESDEP
)
59 OCAMLMKTOP_CMD
=$(OCAMLMKTOP
) -g
-custom
$(INCLUDES
)
61 OBJS
= $(SRC
:.ml
=.cmo
)
62 OPTOBJS
= $(SRC
:.ml
=.cmx
)
65 ##############################################################################
67 ##############################################################################
68 ifneq ($(FEATURE_OCAMLBUILD
),yes
)
71 @
$(MAKE
) $(TARGET
).cmxa BUILD_OPT
=yes
73 $(TARGET
).cma
: $(OBJS
)
74 $(OCAMLC_CMD
) -a
-o
$(TARGET
).cma
$(OBJS
)
76 $(TARGET
).cmxa
: $(OPTOBJS
) $(LIBS
:.cma
=.cmxa
)
77 $(OCAMLOPT_CMD
) -a
-o
$(TARGET
).cmxa
$(OPTOBJS
)
79 $(TARGET
).top
: $(OBJS
) $(LIBS
)
80 $(OCAMLMKTOP_CMD
) -o
$(TARGET
).top
$(SYSLIBS
) $(LIBS
) $(OBJS
)
85 lexer_c.ml
: lexer_c.mll
90 parser_c.ml parser_c.mli
: parser_c.mly
93 rm -f parser_c.ml parser_c.mli parser_c.output
96 cd ..
&& $(OCAMLBUILD
) parsing_c
/parsing_c.cma
99 cd ..
&& $(OCAMLBUILD
) parsing_c
/parsing_c.cmxa
102 cd ..
&& $(OCAMLBUILD
) -clean
106 ##############################################################################
108 ##############################################################################
109 # visitor_c.ml lib_parsing_c.ml \
110 # type_annoter_c.ml \
112 # pretty_print_c.ml unparse_c.ml \
114 #toreput: compare_c.ml ast_to_flow.ml
116 COREPARSING
= flag_parsing_c.ml parsing_stat.ml \
118 ast_c.ml control_flow_c.ml \
119 semantic_c.ml lexer_parser.ml parser_c.mly lexer_c.mll \
120 token_helpers.ml parsing_hacks.ml parse_c.ml \
128 wc
-l parsing_hacks.ml
132 ##############################################################################
133 # Literate Programming rules
134 ##############################################################################
137 ##############################################################################
139 ##############################################################################
141 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
148 $(OCAMLOPT_CMD
) -c
$<
151 rm -f
*.cm
[ioxa
] *.o
*.a
*.cmxa
*.annot
152 rm -f
*~ .
*~ gmon.out
#*#
157 .depend depend
: lexer_c.ml parser_c.ml parser_c.mli
158 $(OCAMLDEP_CMD
) *.mli
*.ml
> .depend
160 ifneq ($(MAKECMDGOALS
),clean)
161 ifneq ($(MAKECMDGOALS
),distclean)
162 ifneq ($(FEATURE_OCAMLBUILD
),yes
)
168 include ..
/Makefile.common