Makefile.in 12.4 KB
Newer Older
pj2m's avatar
pj2m committed
1

bguillaum's avatar
bguillaum committed
2
FILES_DEP = grew_utils grew_ast grew_html grew_fs grew_edge grew_node grew_graph grew_types grew_command grew_rule grew_grs
pj2m's avatar
pj2m committed
3 4 5 6 7 8 9 10 11 12 13 14 15
FILES_ML = $(FILES_DEP:%=%.ml)
FILES_MLI = $(FILES_DEP:%=%.mli)
FILES_CMI = $(FILES_DEP:%=%.cmi)
FILES_CMO = $(FILES_DEP:%=%.cmo)
FILES_CMX = $(FILES_DEP:%=%.cmx)

PARSER_DEP = parser_global lexer gr_grs_parser grew_parser
PARSER_ML = $(PARSER_DEP:%=%.ml)
PARSER_MLI = $(PARSER_DEP:%=%.mli)
PARSER_CMI = $(PARSER_DEP:%=%.cmi)
PARSER_CMO = $(PARSER_DEP:%=%.cmo)
PARSER_CMX = $(PARSER_DEP:%=%.cmx)

bguillaum's avatar
bguillaum committed
16
.PHONY: parser
pj2m's avatar
pj2m committed
17

bguillaum's avatar
bguillaum committed
18 19
all: grew_utils.cmx grew_ast.cmx parser grew test
byte: grew_utils.cmo grew_ast.cmo parser.byte grew.byte test.byte
pj2m's avatar
pj2m committed
20 21 22 23 24 25 26 27


include ../config/Makefile



#executables

bguillaum's avatar
bguillaum committed
28
grew.byte: $(FILES_CMO) parser/parser_global.cmo parser_byte parser/grew_parser.cmo grew.ml
bguillaum's avatar
bguillaum committed
29
	$(OCAMLC) $(BYTE_FLAGS) -o grew.byte $(ANSITERMINAL_BYTE) $(LOG_BYTE)  \
bguillaum's avatar
bguillaum committed
30
	$(FILES_CMO) -I parser $(PARSER_CMO) \
pj2m's avatar
pj2m committed
31 32
	grew.ml

bguillaum's avatar
bguillaum committed
33
grew: $(FILES_CMX) parser/parser_global.cmx parser_opt parser/grew_parser.cmx grew.ml
bguillaum's avatar
bguillaum committed
34
	$(OCAMLOPT) $(OPT_FLAGS) -o grew str.cmxa unix.cmxa $(ANSITERMINAL_OPT) $(LOG_OPT) \
bguillaum's avatar
bguillaum committed
35
	$(FILES_CMX) -I parser $(PARSER_CMX) \
pj2m's avatar
pj2m committed
36 37
	grew.ml

bguillaum's avatar
bguillaum committed
38
test.byte: parser/parser_global.cmo parser_byte parser/grew_parser.cmo $(FILES_CMO) $(FILES_CMI) test.ml
bguillaum's avatar
bguillaum committed
39
	$(OCAMLC) $(BYTE_FLAGS) -o test.byte $(ANSITERMINAL_BYTE) $(LOG_BYTE) \
bguillaum's avatar
bguillaum committed
40
	$(FILES_CMO) -I parser $(PARSER_CMO) \
pj2m's avatar
pj2m committed
41 42
	test.ml

bguillaum's avatar
bguillaum committed
43
test: parser/parser_global.cmx parser_opt parser/grew_parser.cmx $(FILES_CMX) $(FILES_CMI) test.ml
bguillaum's avatar
bguillaum committed
44
	$(OCAMLOPT) $(OPT_FLAGS) -o test str.cmxa unix.cmxa $(ANSITERMINAL_OPT) $(LOG_OPT) \
bguillaum's avatar
bguillaum committed
45
	$(FILES_CMX) -I parser $(PARSER_CMX) \
pj2m's avatar
pj2m committed
46 47 48 49 50 51 52 53 54 55 56
	test.ml

#parser
parser_opt: 
	@make -C parser

parser_byte: 
	@make -C parser byte

# librairie

57
libgrew.mli : grew_types.mli libgrew_.mli
pj2m's avatar
pj2m committed
58 59 60 61 62 63 64 65 66 67 68 69 70
	rm -rf libgrew.mli
	touch libgrew.mli
	echo "(** Grew Library" > libgrew.mli
	echo "@author paul.masson\@inria.fr" >> libgrew.mli
	echo "@author bruno.guillaumme\@inria.fr" >> libgrew.mli
	echo "@version 1.0.0" >> libgrew.mli
	echo "*)" >> libgrew.mli
	echo "" >> libgrew.mli
	cat grew_types.mli >> libgrew.mli
	echo "" >> libgrew.mli
	echo "" >> libgrew.mli
	cat libgrew_.mli >> libgrew.mli

bguillaum's avatar
bguillaum committed
71
libgrew.cma : $(FILES_CMO) parser_byte libgrew.mli libgrew.ml
pj2m's avatar
pj2m committed
72
ifeq (@DEP2PICT@,no) 
bguillaum's avatar
bguillaum committed
73 74
	$(OCAMLC) -c -pp 'camlp4o pa_macro.cmo' $(BYPE_FLAGS) $(FILES_CMO) str.cma -I parser $(PARSER_CMO) libgrew.mli
	$(OCAMLC) -a -o libgrew.cma $(BYPE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -linkall $(FILES_CMO) -I parser $(PARSER_CMO) libgrew.ml
pj2m's avatar
pj2m committed
75
else
bguillaum's avatar
bguillaum committed
76 77
	$(OCAMLC) -c -pp 'camlp4o pa_macro.cmo -DDEP2PICT' $(BYPE_FLAGS) $(FILES_CMO) str.cma -I parser $(PARSER_CMO) libgrew.mli
	$(OCAMLC) -a -o libgrew.cma $(BYPE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\" -DDEP2PICT' -linkall $(FILES_CMO) -I parser $(PARSER_CMO) libgrew.ml
pj2m's avatar
pj2m committed
78
endif
pj2m's avatar
pj2m committed
79

bguillaum's avatar
bguillaum committed
80
libgrew.cmxa : $(FILES_CMX) parser_opt libgrew.mli libgrew.ml
pj2m's avatar
pj2m committed
81
ifeq (@DEP2PICT@,no)
bguillaum's avatar
bguillaum committed
82 83
	$(OCAMLOPT) -c -pp 'camlp4o pa_macro.cmo' $(OPT_FLAGS) $(FILES_CMX) str.cmxa -I parser $(PARSER_CMX) libgrew.mli
	$(OCAMLOPT) -a -o libgrew.cmxa $(OPT_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -linkall $(FILES_CMX) -I parser $(PARSER_CMX) libgrew.ml
pj2m's avatar
pj2m committed
84
else
bguillaum's avatar
bguillaum committed
85 86
	$(OCAMLOPT) -c -pp 'camlp4o pa_macro.cmo -DDEP2PICT' $(FILES_CMX) str.cmxa -I parser $(PARSER_CMX) libgrew.mli
	$(OCAMLOPT) -a -o libgrew.cmxa -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\" -DDEP2PICT' -linkall $(FILES_CMX) -I parser $(PARSER_CMX) libgrew.ml
pj2m's avatar
pj2m committed
87
endif
pj2m's avatar
pj2m committed
88

bguillaum's avatar
bguillaum committed
89
DEPENDS_DIR= -I parser
pj2m's avatar
pj2m committed
90 91 92 93 94 95 96 97

###### grew_core.ml ##############################################################
GREW_CORE_DEP = grew_types
GREW_CORE_CMI = $(GREW_CORE_DEP:%=%.cmi)
GREW_CORE_CMO = $(GREW_CORE_DEP:%=%.cmo)
GREW_CORE_CMX = $(GREW_CORE_DEP:%=%.cmx)

grew_core.cmi: $(GREW_CORE_CMI) grew_core.mli
bguillaum's avatar
bguillaum committed
98
	$(OCAMLC) -c grew_core.mli
pj2m's avatar
pj2m committed
99 100

grew_core.cmo: $(GREW_CORE_CMO) parser_byte grew_core.cmi grew_core.ml
bguillaum's avatar
bguillaum committed
101
	$(OCAMLC) $(BYTE_FLAGS) -c $(DEPENDS_DIR) $(GREW_CORE_CMO) grew_core.ml
pj2m's avatar
pj2m committed
102 103

grew_core.cmx: $(GREW_CORE_CMX) parser_opt grew_core.cmi grew_core.ml
bguillaum's avatar
bguillaum committed
104
	$(OCAMLOPT) $(OPT_FLAGS) -c $(DEPENDS_DIR) $(GREW_CORE_CMX) grew_core.ml
pj2m's avatar
pj2m committed
105 106
################################################################################

bguillaum's avatar
bguillaum committed
107 108 109 110 111
###### grew_utils.ml ##############################################################
GREW_UTILS_DEP = 
GREW_UTILS_CMI = $(GREW_UTILS_DEP:%=%.cmi)
GREW_UTILS_CMO = $(GREW_UTILS_DEP:%=%.cmo)
GREW_UTILS_CMX = $(GREW_UTILS_DEP:%=%.cmx)
pj2m's avatar
pj2m committed
112

bguillaum's avatar
bguillaum committed
113
grew_utils.cmi: $(GREW_UTILS_CMI) grew_utils.mli
bguillaum's avatar
bguillaum committed
114
	$(OCAMLC) -c grew_utils.mli
pj2m's avatar
pj2m committed
115

bguillaum's avatar
bguillaum committed
116
grew_utils.cmo: $(GREW_UTILS_CMO) grew_utils.cmi grew_utils.ml
bguillaum's avatar
bguillaum committed
117
	$(OCAMLC) $(BYTE_FLAGS) -c $(DEPENDS_DIR) grew_utils.ml
pj2m's avatar
pj2m committed
118

bguillaum's avatar
bguillaum committed
119
grew_utils.cmx: $(GREW_UTILS_CMX) grew_utils.cmi grew_utils.ml
bguillaum's avatar
bguillaum committed
120
	$(OCAMLOPT) $(OPT_FLAGS) -c $(DEPENDS_DIR) grew_utils.ml
pj2m's avatar
pj2m committed
121 122 123
################################################################################


bguillaum's avatar
bguillaum committed
124 125 126 127 128
###### grew_ast.ml ##############################################################
GREW_AST_DEP = grew_utils
GREW_AST_CMI = $(GREW_AST_DEP:%=%.cmi)
GREW_AST_CMO = $(GREW_AST_DEP:%=%.cmo)
GREW_AST_CMX = $(GREW_AST_DEP:%=%.cmx)
pj2m's avatar
pj2m committed
129

bguillaum's avatar
bguillaum committed
130
grew_ast.cmi: $(GREW_AST_CMI) grew_ast.mli
bguillaum's avatar
bguillaum committed
131
	$(OCAMLC) -c grew_ast.mli
pj2m's avatar
pj2m committed
132

bguillaum's avatar
bguillaum committed
133
grew_ast.cmo: $(GREW_AST_CMO) grew_ast.cmi grew_ast.ml
bguillaum's avatar
bguillaum committed
134
	$(OCAMLC) $(BYTE_FLAGS) -c $(DEPENDS_DIR) grew_ast.ml
pj2m's avatar
pj2m committed
135

bguillaum's avatar
bguillaum committed
136
grew_ast.cmx: $(GREW_AST_CMX) grew_ast.cmi grew_ast.ml
bguillaum's avatar
bguillaum committed
137
	$(OCAMLOPT) $(OPT_FLAGS) -c $(DEPENDS_DIR) grew_ast.ml
pj2m's avatar
pj2m committed
138 139 140
################################################################################


bguillaum's avatar
bguillaum committed
141 142 143 144 145 146 147
###### grew_html.ml ##############################################################
GREW_HTML_DEP = grew_utils grew_ast
GREW_HTML_CMI = $(GREW_HTML_DEP:%=%.cmi)
GREW_HTML_CMO = $(GREW_HTML_DEP:%=%.cmo)
GREW_HTML_CMX = $(GREW_HTML_DEP:%=%.cmx)

grew_html.cmi: $(GREW_HTML_CMI) grew_html.mli
bguillaum's avatar
bguillaum committed
148
	$(OCAMLC) -c grew_html.mli
bguillaum's avatar
bguillaum committed
149 150

grew_html.cmo: $(GREW_HTML_CMO) grew_html.cmi grew_html.ml
bguillaum's avatar
bguillaum committed
151
	$(OCAMLC) $(BYTE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -c $(DEPENDS_DIR) grew_html.ml
bguillaum's avatar
bguillaum committed
152 153

grew_html.cmx: $(GREW_HTML_CMX) grew_html.cmi grew_html.ml
bguillaum's avatar
bguillaum committed
154
	$(OCAMLOPT) $(OPT_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -c $(DEPENDS_DIR) grew_html.ml
bguillaum's avatar
bguillaum committed
155 156
################################################################################

pj2m's avatar
pj2m committed
157
###### grew_fs.ml ##############################################################
bguillaum's avatar
bguillaum committed
158
GREW_FS_DEP = grew_utils grew_ast
pj2m's avatar
pj2m committed
159 160 161 162 163
GREW_FS_CMI = $(GREW_FS_DEP:%=%.cmi)
GREW_FS_CMO = $(GREW_FS_DEP:%=%.cmo)
GREW_FS_CMX = $(GREW_FS_DEP:%=%.cmx)

grew_fs.cmi: $(GREW_FS_CMI) grew_fs.mli
bguillaum's avatar
bguillaum committed
164
	$(OCAMLC) -c grew_fs.mli
pj2m's avatar
pj2m committed
165 166

grew_fs.cmo: $(GREW_FS_CMO) grew_fs.cmi grew_fs.ml
bguillaum's avatar
bguillaum committed
167
	$(OCAMLC) $(BYTE_FLAGS) -c $(DEPENDS_DIR) grew_fs.ml
pj2m's avatar
pj2m committed
168 169

grew_fs.cmx: $(GREW_FS_CMX) grew_fs.cmi grew_fs.ml
bguillaum's avatar
bguillaum committed
170
	$(OCAMLOPT) $(OPT_FLAGS) -c $(DEPENDS_DIR) grew_fs.ml
pj2m's avatar
pj2m committed
171 172 173 174
################################################################################


###### grew_edge.ml ##############################################################
bguillaum's avatar
bguillaum committed
175
GREW_EDGE_DEP = grew_utils grew_ast
pj2m's avatar
pj2m committed
176 177 178 179 180
GREW_EDGE_CMI = $(GREW_EDGE_DEP:%=%.cmi)
GREW_EDGE_CMO = $(GREW_EDGE_DEP:%=%.cmo)
GREW_EDGE_CMX = $(GREW_EDGE_DEP:%=%.cmx)

grew_edge.cmi: $(GREW_EDGE_CMI) grew_edge.mli
bguillaum's avatar
bguillaum committed
181
	$(OCAMLC) -c grew_edge.mli
pj2m's avatar
pj2m committed
182 183

grew_edge.cmo: $(GREW_EDGE_CMO) grew_edge.cmi grew_edge.ml
bguillaum's avatar
bguillaum committed
184
	$(OCAMLC) $(BYTE_FLAGS) -c $(DEPENDS_DIR) grew_edge.ml
pj2m's avatar
pj2m committed
185 186

grew_edge.cmx: $(GREW_EDGE_CMX) grew_edge.cmi grew_edge.ml
bguillaum's avatar
bguillaum committed
187
	$(OCAMLOPT) $(OPT_FLAGS) -c $(DEPENDS_DIR) grew_edge.ml
pj2m's avatar
pj2m committed
188 189 190 191
################################################################################


###### grew_node.ml ##############################################################
bguillaum's avatar
bguillaum committed
192
GREW_NODE_DEP = grew_utils grew_ast grew_fs grew_edge
pj2m's avatar
pj2m committed
193 194 195 196 197
GREW_NODE_CMI = $(GREW_NODE_DEP:%=%.cmi)
GREW_NODE_CMO = $(GREW_NODE_DEP:%=%.cmo)
GREW_NODE_CMX = $(GREW_NODE_DEP:%=%.cmx)

grew_node.cmi: $(GREW_NODE_CMI) grew_node.mli
bguillaum's avatar
bguillaum committed
198
	$(OCAMLC) -c grew_node.mli
pj2m's avatar
pj2m committed
199 200

grew_node.cmo: $(GREW_NODE_CMO) grew_node.cmi grew_node.ml
bguillaum's avatar
bguillaum committed
201
	$(OCAMLC) $(BYTE_FLAGS) -c $(DEPENDS_DIR) grew_node.ml
pj2m's avatar
pj2m committed
202 203

grew_node.cmx: $(GREW_NODE_CMX) grew_node.cmi grew_node.ml
bguillaum's avatar
bguillaum committed
204
	$(OCAMLOPT) $(OPT_FLAGS) -c $(DEPENDS_DIR) grew_node.ml
pj2m's avatar
pj2m committed
205 206 207
################################################################################


bguillaum's avatar
bguillaum committed
208 209 210 211 212
###### grew_graph.ml ##############################################################
GREW_GRAPH_DEP = grew_utils grew_ast grew_command grew_edge grew_fs grew_node 
GREW_GRAPH_CMI = $(GREW_GRAPH_DEP:%=%.cmi)
GREW_GRAPH_CMO = $(GREW_GRAPH_DEP:%=%.cmo)
GREW_GRAPH_CMX = $(GREW_GRAPH_DEP:%=%.cmx)
pj2m's avatar
pj2m committed
213

bguillaum's avatar
bguillaum committed
214
grew_graph.cmi: $(GREW_GRAPH_CMI) grew_graph.mli
bguillaum's avatar
bguillaum committed
215
	$(OCAMLC) -c grew_graph.mli
pj2m's avatar
pj2m committed
216

bguillaum's avatar
bguillaum committed
217
grew_graph.cmo: $(GREW_GRAPH_CMO) grew_graph.cmi grew_graph.ml
bguillaum's avatar
bguillaum committed
218
	$(OCAMLC) $(BYTE_FLAGS) -c $(DEPENDS_DIR) grew_graph.ml
pj2m's avatar
pj2m committed
219

bguillaum's avatar
bguillaum committed
220
grew_graph.cmx: $(GREW_GRAPH_CMX) grew_graph.cmi grew_graph.ml
bguillaum's avatar
bguillaum committed
221
	$(OCAMLOPT) $(OPT_FLAGS) -c $(DEPENDS_DIR) grew_graph.ml
pj2m's avatar
pj2m committed
222 223 224 225
################################################################################


###### grew_types.ml ##############################################################
bguillaum's avatar
bguillaum committed
226
GREW_TYPES_DEP = grew_graph 
pj2m's avatar
pj2m committed
227 228 229 230 231
GREW_TYPES_CMI = $(GREW_TYPES_DEP:%=%.cmi)
GREW_TYPES_CMO = $(GREW_TYPES_DEP:%=%.cmo)
GREW_TYPES_CMX = $(GREW_TYPES_DEP:%=%.cmx)

grew_types.cmi: $(GREW_TYPES_CMI) grew_types.mli
bguillaum's avatar
bguillaum committed
232
	$(OCAMLC) -c grew_types.mli
pj2m's avatar
pj2m committed
233 234

grew_types.cmo: $(GREW_TYPES_CMO) grew_types.cmi grew_types.ml
bguillaum's avatar
bguillaum committed
235
	$(OCAMLC) $(BYTE_FLAGS) -c $(DEPENDS_DIR) grew_types.ml
pj2m's avatar
pj2m committed
236 237

grew_types.cmx: $(GREW_TYPES_CMX) grew_types.cmi grew_types.ml
bguillaum's avatar
bguillaum committed
238
	$(OCAMLOPT) $(OPT_FLAGS) -c $(DEPENDS_DIR) grew_types.ml
pj2m's avatar
pj2m committed
239 240 241
################################################################################


bguillaum's avatar
bguillaum committed
242 243 244 245 246
###### grew_command.ml ##############################################################
GREW_COMMAND_DEP = grew_utils grew_ast grew_edge grew_fs
GREW_COMMAND_CMI = $(GREW_COMMAND_DEP:%=%.cmi)
GREW_COMMAND_CMO = $(GREW_COMMAND_DEP:%=%.cmo)
GREW_COMMAND_CMX = $(GREW_COMMAND_DEP:%=%.cmx)
pj2m's avatar
pj2m committed
247

bguillaum's avatar
bguillaum committed
248
grew_command.cmi: $(GREW_COMMAND_CMI) grew_command.mli
bguillaum's avatar
bguillaum committed
249
	$(OCAMLC) -c grew_command.mli
pj2m's avatar
pj2m committed
250

bguillaum's avatar
bguillaum committed
251
grew_command.cmo: $(GREW_COMMAND_CMO) grew_command.cmi grew_command.ml
bguillaum's avatar
bguillaum committed
252
	$(OCAMLC) $(BYTE_FLAGS) -c $(DEPENDS_DIR) grew_command.ml
pj2m's avatar
pj2m committed
253

bguillaum's avatar
bguillaum committed
254
grew_command.cmx: $(GREW_COMMAND_CMX) grew_command.cmi grew_command.ml
bguillaum's avatar
bguillaum committed
255
	$(OCAMLOPT) $(OPT_FLAGS) -c $(DEPENDS_DIR) grew_command.ml
pj2m's avatar
pj2m committed
256 257 258
################################################################################


bguillaum's avatar
bguillaum committed
259 260 261 262 263
###### grew_rule.ml ##############################################################
GREW_RULE_DEP = grew_utils grew_ast grew_command grew_edge grew_fs grew_node grew_types grew_graph
GREW_RULE_CMI = $(GREW_RULE_DEP:%=%.cmi)
GREW_RULE_CMO = $(GREW_RULE_DEP:%=%.cmo)
GREW_RULE_CMX = $(GREW_RULE_DEP:%=%.cmx)
pj2m's avatar
pj2m committed
264

bguillaum's avatar
bguillaum committed
265
grew_rule.cmi: $(GREW_RULE_CMI) grew_rule.mli
pj2m's avatar
pj2m committed
266
ifeq (@DEP2PICT@,no)
bguillaum's avatar
bguillaum committed
267
	$(OCAMLC) -c -pp 'camlp4o pa_macro.cmo' grew_rule.mli
pj2m's avatar
pj2m committed
268
else
bguillaum's avatar
bguillaum committed
269
	$(OCAMLC) -c -pp 'camlp4o pa_macro.cmo -DDEP2PICT' grew_rule.mli
pj2m's avatar
pj2m committed
270
endif
pj2m's avatar
pj2m committed
271

bguillaum's avatar
bguillaum committed
272
grew_rule.cmo: $(GREW_RULE_CMO) grew_rule.cmi grew_rule.ml
pj2m's avatar
pj2m committed
273
ifeq (@DEP2PICT@,no)
bguillaum's avatar
bguillaum committed
274
	$(OCAMLC) -pp 'camlp4o pa_macro.cmo' $(BYTE_FLAGS) -c $(DEPENDS_DIR) grew_rule.ml
pj2m's avatar
pj2m committed
275
else
bguillaum's avatar
bguillaum committed
276
	$(OCAMLC) -pp 'camlp4o pa_macro.cmo -DDEP2PICT' $(BYTE_FLAGS) -c $(DEPENDS_DIR) $(DEP2PICT_BYTE) grew_rule.ml
pj2m's avatar
pj2m committed
277
endif
pj2m's avatar
pj2m committed
278

bguillaum's avatar
bguillaum committed
279
grew_rule.cmx: $(GREW_RULE_CMX) grew_rule.cmi grew_rule.ml
pj2m's avatar
pj2m committed
280
ifeq (@DEP2PICT@,no)
bguillaum's avatar
bguillaum committed
281
	$(OCAMLOPT) -pp 'camlp4o pa_macro.cmo' $(OPT_FLAGS) -c $(DEPENDS_DIR) grew_rule.ml
pj2m's avatar
pj2m committed
282
else
bguillaum's avatar
bguillaum committed
283
	$(OCAMLOPT) -pp 'camlp4o pa_macro.cmo -DDEP2PICT' $(OPT_FLAGS) -c $(DEPENDS_DIR) $(DEP2PICT_OPT) grew_rule.ml
pj2m's avatar
pj2m committed
284
endif
pj2m's avatar
pj2m committed
285 286 287
################################################################################


bguillaum's avatar
bguillaum committed
288 289 290 291 292
###### grew_grs.ml ##############################################################
GREW_GRS_DEP = grew_utils grew_edge grew_types grew_graph grew_rule
GREW_GRS_CMI = $(GREW_GRS_DEP:%=%.cmi)
GREW_GRS_CMO = $(GREW_GRS_DEP:%=%.cmo)
GREW_GRS_CMX = $(GREW_GRS_DEP:%=%.cmx)
pj2m's avatar
pj2m committed
293

bguillaum's avatar
bguillaum committed
294
grew_grs.cmi: $(GREW_GRS_CMI) grew_grs.mli
pj2m's avatar
pj2m committed
295
ifeq (@DEP2PICT@,no)
bguillaum's avatar
bguillaum committed
296
	$(OCAMLC) -c -pp 'camlp4o pa_macro.cmo' grew_grs.mli
pj2m's avatar
pj2m committed
297
else
bguillaum's avatar
bguillaum committed
298
	$(OCAMLC) -c -pp 'camlp4o pa_macro.cmo -DDEP2PICT' grew_grs.mli
pj2m's avatar
pj2m committed
299
endif
pj2m's avatar
pj2m committed
300

bguillaum's avatar
bguillaum committed
301
grew_grs.cmo: $(GREW_GRS_CMO) grew_grs.cmi grew_grs.ml
pj2m's avatar
pj2m committed
302
ifeq (@DEP2PICT@,no)
bguillaum's avatar
bguillaum committed
303
	$(OCAMLC) $(BYTE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -c $(DEPENDS_DIR) grew_grs.ml
pj2m's avatar
pj2m committed
304
else
bguillaum's avatar
bguillaum committed
305
	$(OCAMLC) $(BYTE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\" -DDEP2PICT' -c $(DEPENDS_DIR) grew_grs.ml
pj2m's avatar
pj2m committed
306
endif
pj2m's avatar
pj2m committed
307

bguillaum's avatar
bguillaum committed
308
grew_grs.cmx: $(GREW_GRS_CMX) grew_grs.cmi grew_grs.ml
pj2m's avatar
pj2m committed
309
ifeq (@DEP2PICT@,no)
bguillaum's avatar
bguillaum committed
310
	$(OCAMLOPT) $(OPT_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -c $(DEPENDS_DIR) grew_grs.ml
pj2m's avatar
pj2m committed
311
else
bguillaum's avatar
bguillaum committed
312
	$(OCAMLOPT) $(OPT_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\" -DDEP2PICT' -c $(DEPENDS_DIR) grew_grs.ml
pj2m's avatar
pj2m committed
313
endif
pj2m's avatar
pj2m committed
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328
################################################################################

# others

dep:
	rm depend
	ocamldep *.ml* > depend


clean: 
	@make -C parser clean
	rm -rf *.cmi *.cmo *.cmxa *.cma *.cmx *.o *.annot
	rm -f grew grew.byte
	rm -f test test.byte
	rm -f *.nf *.png *.html
329
	rm -f libgrew.mli
pj2m's avatar
pj2m committed
330 331 332 333 334 335 336 337 338 339

purge_makefile:
	@make -C parser purge
	@make purge

doc:
	rm libgrew.mli
	@make libgrew.mli
	mkdir -p ../doc
	ocamldoc -html -d ../doc libgrew.mli