2
-include ../Makefile.config
4
##############################################################################
6
##############################################################################
9
-include ../Makefile.config
11
ifeq ($(FEATURE_TARZAN), 1)
12
TARZANSRC=sexp_ast_c.ml
13
TARZANINCLUDE=-I ../ocamlsexp
18
# - type_cocci.ml ast_cocci.ml # + unparse_hrule
19
SRC= flag_parsing_c.ml parsing_stat.ml \
20
token_c.ml ast_c.ml control_flow_c.ml \
22
visitor_c.ml lib_parsing_c.ml \
23
control_flow_c_build.ml \
25
semantic_c.ml lexer_parser.ml parser_c.ml lexer_c.ml \
26
token_helpers.ml token_views_c.ml \
30
unparse_cocci.ml unparse_c.ml unparse_hrule.ml \
31
parsing_recovery_c.ml parsing_consistency_c.ml \
32
parse_c.ml type_c.ml \
34
type_annoter_c.ml comment_annotater_c.ml \
40
# ast_cocci.ml and unparse_cocci.ml should be deleted in the futur
41
# to make parsing_c really independent of coccinelle.
42
# control_flow_c have also coccinelle dependencies.
43
# old: parsing_c now depends on cocci_parser because in addition to decorate
44
# the token in Ast_c with some parse info, we now also make some place to
45
# welcome some mcodekind of Ast_cocci.
46
LIBS=../commons/commons.cma ../globals/globals.cma \
47
../parsing_cocci/cocci_parser.cma
49
INCLUDES= -I ../commons -I ../commons/ocamlextra -I ../commons/ocollection \
51
-I ../globals -I ../parsing_cocci
53
#LIBS=../commons/commons.cma
54
#INCLUDES= -I ../commons
55
SYSLIBS= str.cma unix.cma num.cma
57
##############################################################################
59
##############################################################################
62
#for profiling: -p -inline 0 with OCAMLOPT
63
OCAMLCFLAGS ?= -g -dtypes
65
OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
66
OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
67
OCAMLLEX=ocamllex$(OPTBIN) #-ml
68
OCAMLYACC=ocamlyacc -v
69
OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDES)
70
OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
73
OBJS = $(SRC:.ml=.cmo)
74
OPTOBJS = $(SRC:.ml=.cmx)
77
##############################################################################
79
##############################################################################
81
all.opt: $(TARGET).cmxa
83
$(TARGET).cma: $(OBJS)
84
$(OCAMLC) -a -o $(TARGET).cma $(OBJS)
86
$(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
87
$(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS)
89
$(TARGET).top: $(OBJS) $(LIBS)
90
$(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
95
lexer_c.ml: lexer_c.mll
99
beforedepend:: lexer_c.ml
102
parser_c.ml parser_c.mli: parser_c.mly
105
rm -f parser_c.ml parser_c.mli parser_c.output
106
beforedepend:: parser_c.ml parser_c.mli
109
##############################################################################
111
##############################################################################
112
# visitor_c.ml lib_parsing_c.ml \
113
# type_annoter_c.ml \
115
# pretty_print_c.ml unparse_c.ml \
117
#toreput: compare_c.ml ast_to_flow.ml
119
COREPARSING= flag_parsing_c.ml parsing_stat.ml \
121
ast_c.ml control_flow_c.ml \
122
semantic_c.ml lexer_parser.ml parser_c.mly lexer_c.mll \
123
token_helpers.ml parsing_hacks.ml parse_c.ml \
131
wc -l parsing_hacks.ml
135
##############################################################################
136
# Literate Programming rules
137
##############################################################################
140
##############################################################################
142
##############################################################################
144
.SUFFIXES: .ml .mli .cmo .cmi .cmx
157
rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot
158
rm -f *~ .*~ gmon.out #*#
168
depend:: beforedepend
169
$(OCAMLDEP) *.mli *.ml > .depend