forked from backtracking/ocamlgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
589 lines (451 loc) · 15.9 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
##########################################################################
# #
# Ocamlgraph: a generic graph library for OCaml #
# Copyright (C) 2004-2010 #
# Sylvain Conchon, Jean-Christophe Filliatre and Julien Signoles #
# #
# This software is free software; you can redistribute it and/or #
# modify it under the terms of the GNU Library General Public #
# License version 2.1, with the special exception on linking #
# described in file LICENSE. #
# #
# This software is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
# #
##########################################################################
# Where to install the binaries
DESTDIR =
prefix =@prefix@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@
BINDIR =$(DESTDIR)@bindir@
# Where to install the man page
MANDIR=@mandir@
# Other variables set by ./configure
OCAMLC = @OCAMLC@
OCAMLOPT = @OCAMLOPT@
OCAMLDEP = @OCAMLDEP@ -slash
OCAMLDOC = @OCAMLDOC@
OCAMLLEX = @OCAMLLEX@
OCAMLYACC= @OCAMLYACC@ -v
OCAMLLIB = @OCAMLLIB@
OCAMLBEST= @OCAMLBEST@
OCAMLVERSION = @OCAMLVERSION@
OCAMLWEB = @OCAMLWEB@
OCAMLWIN32 = @OCAMLWIN32@
OCAMLFIND = @OCAMLFIND@
EXE = @EXE@
LIBEXT = @LIBEXT@
OBJEXT = @OBJEXT@
# Others global variables
SRCDIR = src
LIBDIR = lib
INCLUDES= -I $(SRCDIR) -I $(LIBDIR)
BFLAGS = $(INCLUDES) -g -dtypes
OFLAGS = $(INCLUDES)
# main target
#############
NAME=ocamlgraph
ifeq (@LABLGNOMECANVAS@,yes)
all: byte $(OCAMLBEST) viewer dgraph editor
else
all: byte $(OCAMLBEST)
endif
# bytecode and native-code compilation
######################################
LIB= unionfind heap bitv
LIB:=$(patsubst %, $(LIBDIR)/%.cmo, $(LIB))
CMO = version util blocks persistent imperative \
delaunay builder classic rand oper \
components path nonnegative traverse coloring topological kruskal flow \
dominator graphviz gml dot_parser dot_lexer dot pack \
gmap minsep cliquetree mcs_m md strat fixpoint leaderlist contraction \
graphml merge
CMO := $(LIB) $(patsubst %, $(SRCDIR)/%.cmo, $(CMO))
CMX = $(CMO:.cmo=.cmx)
CMA = graph.cma
CMXA = graph.cmxa
CMI = sig sig_pack dot_ast
CMI := $(patsubst %, src/%.cmi, $(CMI))
GENERATED = META \
src/gml.ml src/version.ml \
src/dot_parser.ml src/dot_parser.mli src/dot_lexer.ml
$(CMX): OFLAGS += -for-pack Graph
byte: $(CMA)
opt: $(CMXA)
graph.cma: graph.cmo
$(OCAMLC) $(INCLUDES) -a -g -o $@ $^
graph.cmxa: graph.cmx
$(OCAMLOPT) $(INCLUDES) -a -o $@ $^
graph.cmi: graph.cmo
graph.o: graph.cmx
graph.cmo: $(CMI) $(CMO)
$(OCAMLC) $(INCLUDES) -pack -g -o $@ $^
graph.cmx: $(CMI) $(CMX)
$(OCAMLOPT) $(INCLUDES) -pack -o $@ $^
VERSION=1.8.3
src/version.ml: Makefile
rm -f $@
echo "let version = \""$(VERSION)"\"" > $@
echo "let date = \""`date`"\"" >> $@
# gtk2 graph editor
###################
ED_DIR=editor
editor: $(ED_DIR)/editor.byte $(ED_DIR)/editor.$(OCAMLBEST)
ED_CMO = ed_hyper ed_graph ed_draw ed_display ed_main
ED_CMO:= $(patsubst %, $(ED_DIR)/%.cmo, $(ED_CMO))
ED_CMX = $(ED_CMO:.cmo=.cmx)
ED_CMI = $(ED_CMO:.cmo=.cmi)
ED_INCLUDES = @INCLUDEGTK2@ -I +threads -I $(ED_DIR) $(INCLUDES) -I .
$(ED_CMI) $(ED_CMO): BFLAGS+= $(ED_INCLUDES)
$(ED_CMI) $(ED_CMO): $(CMA)
$(ED_CMX): OFLAGS+= $(ED_INCLUDES)
$(ED_CMX): $(CMXA)
$(ED_DIR)/editor.byte: $(CMA) $(ED_CMO)
$(OCAMLC) -g -o $@ $(ED_INCLUDES) \
lablgtk.cma lablgnomecanvas.cma unix.cma $^
$(ED_DIR)/editor.opt: $(CMXA) $(ED_CMX)
$(OCAMLOPT) -o $@ $(ED_INCLUDES) \
lablgtk.cmxa lablgnomecanvas.cmxa unix.cmxa $^
# gtk2 graph viewer (deprecated)
###################
VIEWER_DIR=view_graph
viewer: $(VIEWER_DIR)/viewgraph.byte $(VIEWER_DIR)/viewgraph.$(OCAMLBEST)
VIEWER_CMO=viewGraph_core viewGraph_select viewGraph_utils viewGraph_test
VIEWER_CMO:=$(patsubst %,$(VIEWER_DIR)/%.cmo, $(VIEWER_CMO))
VIEWER_CMX=$(VIEWER_CMO:.cmo=.cmx)
VIEWER_CMI=$(VIEWER_CMO:.cmo=.cmi)
VIEWER_MLI=$(VIEWER_CMI:.cmi=.mli)
VIEWER_INCLUDES= @INCLUDEGTK2@ -I $(VIEWER_DIR) $(INCLUDES) -I .
$(VIEWER_CMI) $(VIEWER_CMO): BFLAGS+= $(VIEWER_INCLUDES)
$(VIEWER_CMX): OFLAGS+= $(VIEWER_INCLUDES) -for-pack Viewgraph
$(VIEWER_CMI) $(VIEWER_CMO): $(CMA)
$(VIEWER_CMX): $(CMXA)
VIEWER_CMOLIB = $(VIEWER_DIR)/viewgraph.cmo
VIEWER_CMILIB = $(VIEWER_DIR)/viewgraph.cmi
VIEWER_CMXLIB = $(VIEWER_DIR)/viewgraph.cmx
$(VIEWER_CMOLIB): $(filter-out $(VIEWER_DIR)/viewGraph_test.cmo, $(VIEWER_CMO))
$(OCAMLC) -o $@ $(VIEWER_INCLUDES) -pack $^
$(VIEWER_CMXLIB): $(filter-out $(VIEWER_DIR)/viewGraph_test.cmx, $(VIEWER_CMX))
$(OCAMLOPT) -o $@ $(VIEWER_INCLUDES) -pack $^
$(VIEWER_DIR)/viewgraph.byte: $(CMA) $(VIEWER_CMOLIB)
$(OCAMLC) -g -o $@ $(VIEWER_INCLUDES) \
lablgtk.cma gtkInit.cmo lablgnomecanvas.cma unix.cma $^
$(VIEWER_DIR)/viewgraph.opt: $(CMXA) $(VIEWER_CMXLIB)
$(OCAMLOPT) -o $@ $(VIEWER_INCLUDES) \
lablgtk.cmxa gtkInit.cmx lablgnomecanvas.cmxa unix.cmxa $^
# new gtk2 graph viewer: dgraph
###############################
DGRAPH_DIR=dgraph
dgraph: $(DGRAPH_DIR)/dgraph.byte $(DGRAPH_DIR)/dgraph.$(OCAMLBEST)
DGRAPH_CMO=xDotDraw xDot \
dGraphModel \
dGraphTreeLayout dGraphSubTree dGraphTreeModel \
dGraphViewItem dGraphView \
dGraphRandModel dGraphContainer \
dGraphViewer
DGRAPH_CMO:=$(patsubst %,$(DGRAPH_DIR)/%.cmo, $(DGRAPH_CMO))
DGRAPH_CMX=$(DGRAPH_CMO:.cmo=.cmx)
DGRAPH_CMI=$(filter-out dgraph/dGraphViewer.cmi, $(DGRAPH_CMO:.cmo=.cmi))
DGRAPH_INCLUDES= @INCLUDEGTK2@ -I $(DGRAPH_DIR) $(INCLUDES) -I .
$(DGRAPH_CMI) $(DGRAPH_CMO): BFLAGS+= $(DGRAPH_INCLUDES)
$(DGRAPH_CMX): OFLAGS+= $(DGRAPH_INCLUDES) -for-pack Dgraph
$(DGRAPH_CMI) $(DGRAPH_CMO): $(CMA)
$(DGRAPH_CMX): $(CMXA)
DGRAPH_CMOLIB = $(DGRAPH_DIR)/dgraph.cmo
DGRAPH_CMILIB = $(DGRAPH_DIR)/dgraph.cmi
DGRAPH_CMXLIB = $(DGRAPH_DIR)/dgraph.cmx
dgraph/dGraphViewer.cmo: $(DGRAPH_CMOLIB)
dgraph/dGraphViewer.cmx: $(DGRAPH_CMXLIB)
$(DGRAPH_CMOLIB): $(filter-out dgraph/dGraphViewer.cmo, $(DGRAPH_CMO))
$(OCAMLC) -o $@ $(DGRAPH_INCLUDES) -pack $^
$(DGRAPH_CMXLIB): $(filter-out dgraph/dGraphViewer.cmx, $(DGRAPH_CMX))
$(OCAMLOPT) -o $@ $(DGRAPH_INCLUDES) -pack $^
$(DGRAPH_DIR)/dgraph.byte: $(CMA) $(DGRAPH_CMOLIB) \
$(DGRAPH_DIR)/dGraphViewer.cmo
$(OCAMLC) -g -o $@ $(DGRAPH_INCLUDES) \
lablgtk.cma gtkInit.cmo lablgnomecanvas.cma $^
$(DGRAPH_DIR)/dgraph.opt: $(CMXA) $(DGRAPH_CMXLIB) \
$(DGRAPH_DIR)/dGraphViewer.cmx
$(OCAMLOPT) -o $@ $(DGRAPH_INCLUDES) \
lablgtk.cmxa gtkInit.cmx lablgnomecanvas.cmxa $^
# Examples
##########
EXAMPLESBIN=bin/demo.$(OCAMLBEST) bin/demo_planar.$(OCAMLBEST) \
bin/bench.$(OCAMLBEST) bin/color.$(OCAMLBEST) bin/sudoku.$(OCAMLBEST) \
bin/test.$(OCAMLBEST)
.PHONY: examples
examples: $(EXAMPLESBIN)
.PHONY: demo
demo: bin/demo.$(OCAMLBEST)
bin/demo.byte: $(CMA) examples/demo.cmo
$(OCAMLC) -o $@ $^
bin/demo.opt: $(CMXA) examples/demo.cmx
$(OCAMLOPT) -o $@ $^
bin/demo_planar.byte: $(CMA) examples/demo_planar.cmo
$(OCAMLC) -o $@ graphics.cma unix.cma $^
bin/demo_planar.opt: $(CMXA) examples/demo_planar.cmx
$(OCAMLOPT) -o $@ graphics.cmxa unix.cmxa $^
bin/color.byte: $(CMA) examples/color.cmo
$(OCAMLC) -o $@ graphics.cma unix.cma $^
bin/color.opt: $(CMXA) examples/color.cmx
$(OCAMLOPT) -o $@ graphics.cmxa unix.cmxa $^
bin/sudoku.byte: $(CMA) examples/sudoku.cmo
$(OCAMLC) -o $@ graphics.cma unix.cma $^
bin/sudoku.opt: $(CMXA) examples/sudoku.cmx
$(OCAMLOPT) -o $@ graphics.cmxa unix.cmxa $^
test: $(CMA) tests/test.ml
ocaml unix.cma graphics.cma $^
test-bf: $(CMA) tests/test_bf.ml
ocaml unix.cma graphics.cma $^
bin/test-ts: $(CMXA) tests/test_topsort.ml
$(OCAMLOPT) -o $@ unix.cmxa $^
test-ts: bin/test-ts
bin/test-ts 10
nonneg: $(CMA) tests/nonneg.ml
ocaml unix.cma graphics.cma $^
test-graphml: $(CMA) tests/testgraphml.ml
ocaml unix.cma $^
bin/test.byte: $(CMA) tests/test.cmo
$(OCAMLC) -g -unsafe -o $@ unix.cma graphics.cma $^
bin/test.opt: $(CMXA) tests/test.cmx
$(OCAMLOPT) -unsafe -inline 100 -o $@ unix.cmxa graphics.cmxa $^
bin/test_bf.byte: $(CMA) tests/test_bf.ml
$(OCAMLC) -g -o $@ unix.cma graphics.cma $^
bin/nonneg.byte: $(CMA) tests/nonneg.ml
$(OCAMLC) -g -o $@ unix.cma graphics.cma $^
bench: bin/bench.$(OCAMLBEST)
bin/bench.opt
bin/bench.opt: $(CMXA) tests/bench.ml
$(OCAMLOPT) -unsafe -inline 100 -o $@ unix.cmxa $^
check: $(CMA) tests/check.ml bin/test-ts
ocaml $(CMA) tests/check.ml
bin/test-ts 10
# Additional rules
##################
EXAMPLES = demo color demo_planar sudoku
EXAMPLESBIN:=$(patsubst %, bin/%.opt, $(EXAMPLES))
EXAMPLES:= $(patsubst %, examples/%.ml, $(EXAMPLES))
examples: $(EXAMPLESBIN)
TESTS = test check
TESTS := $(patsubst %, tests/%.ml, $(TESTS))
DPD_GRAPH_ML= $(TESTS) $(EXAMPLES)
$(DPD_GRAPH_ML:.ml=.cmo): $(CMA)
$(DPD_GRAPH_ML:.ml=.cmx): $(CMXA)
# installation
##############
INSTALL_LIBDIR=$(DESTDIR)$(OCAMLLIB)/ocamlgraph
install: install-$(OCAMLBEST) install-byte
mkdir -p $(BINDIR)
ifeq (@LABLGNOMECANVAS@,yes)
ifeq ($(OCAMLBEST),byte)
cp -f $(BINDIR)/graph-editor.byte $(BINDIR)/graph-editor$(EXE)
cp -f $(BINDIR)/graph-viewer.byte $(BINDIR)/graph-viewer$(EXE)
else
cp -f $(BINDIR)/graph-editor.opt $(BINDIR)/graph-editor$(EXE)
cp -f $(BINDIR)/graph-viewer.opt $(BINDIR)/graph-viewer$(EXE)
endif
endif
install-byte:
mkdir -p $(INSTALL_LIBDIR)
cp -f graph.cmo graph.cmi $(CMA) $(INSTALL_LIBDIR)
cp -f $(SRCDIR)/*.mli $(INSTALL_LIBDIR)
ifeq (@LABLGNOMECANVAS@,yes)
mkdir -p $(BINDIR)
cp -f $(ED_DIR)/editor.byte $(BINDIR)/graph-editor.byte
cp -f $(VIEWER_CMILIB) $(VIEWER_CMOLIB) $(INSTALL_LIBDIR)
cp -f $(DGRAPH_CMILIB) $(DGRAPH_CMOLIB) $(INSTALL_LIBDIR)
cp -f $(VIEWER_DIR)/*.mli $(DGRAPH_DIR)/*.mli $(INSTALL_LIBDIR)
cp -f $(DGRAPH_DIR)/dgraph.byte $(BINDIR)/graph-viewer.byte
endif
install-opt: install-byte
mkdir -p $(INSTALL_LIBDIR)
cp -f graph$(LIBEXT) graph.cmi graph.cmx $(CMXA) $(INSTALL_LIBDIR)
cp -f $(SRCDIR)/*.mli $(INSTALL_LIBDIR)
ifeq (@LABLGNOMECANVAS@,yes)
mkdir -p $(BINDIR)
cp -f $(ED_DIR)/editor.opt $(BINDIR)/graph-editor.opt
cp -f $(VIEWER_CMILIB) $(VIEWER_CMXLIB) $(VIEWER_CMXLIB:.cmx=.o) \
$(INSTALL_LIBDIR)
cp -f $(DGRAPH_CMILIB) $(DGRAPH_CMXLIB) $(DGRAPH_CMXLIB:.cmx=.o) \
$(INSTALL_LIBDIR)
cp -f $(DGRAPH_DIR)/dgraph.opt $(BINDIR)/graph-viewer.opt
cp -f $(VIEWER_DIR)/*.mli $(DGRAPH_DIR)/*.mli $(INSTALL_LIBDIR)
endif
install-findlib: META
ifdef OCAMLFIND
ifeq (@LABLGNOMECANVAS@,yes)
$(OCAMLFIND) install ocamlgraph META \
$(SRCDIR)/*.mli $(VIEWER_DIR)/*.mli $(DGRAPH_DIR)/*.mli \
graph$(LIBEXT) graph.cmx graph.cmo graph.cmi $(CMA) $(CMXA) \
$(VIEWER_CMXLIB) $(VIEWER_CMOLIB) $(DGRAPH_CMXLIB) \
$(DGRAPH_CMOLIB)
else
$(OCAMLFIND) install ocamlgraph META \
$(SRCDIR)/*.mli $(VIEWER_DIR)/*.mli $(DGRAPH_DIR)/*.mli \
graph$(LIBEXT) graph.cmx graph.cmo graph.cmi $(CMA) $(CMXA)
endif
endif
META: META.in Makefile
sed -e s/VERSION/$(VERSION)/ -e s/CMA/$(CMA)/ -e s/CMXA/$(CMXA)/ \
[email protected] > $@
# documentation
###############
DOCFILES=$(NAME).ps $(NAME).html
NODOC = blocks dot_parser dot_lexer version
NODOC := $(patsubst %, $(SRCDIR)/%.cmo, $(NODOC))
DOC_CMO = $(filter-out $(NODOC) $(LIB), $(CMO))
DOC_SRC = $(CMI:.cmi=.mli) $(DOC_CMO:.cmo=.mli) $(DOC_CMO:.cmo=.ml)
ifeq (@LABLGNOMECANVAS@,yes)
DOC_SRC := $(DOC_SRC) $(DGRAPH_CMI:.cmi=.mli)
endif
.PHONY: doc
doc: $(DOC_CMO)
mkdir -p doc
rm -f doc/*
$(OCAMLDOC) -d doc -html $(DGRAPH_INCLUDES) $(DOC_SRC)
# literate programming
$(NAME).tex: $(DOC_SRC)
$(OCAMLWEB) -o $@ $^
wc:
ocamlwc -p $(SRCDIR)/*.mli $(SRCDIR)/*.ml
# file headers
##############
headers:
headache \
-c misc/headache_config.txt \
-h misc/header.txt \
Makefile.in configure.in README \
$(LIBDIR)/*.ml $(LIBDIR)/*.ml[ily] \
$(SRCDIR)/*.ml $(SRCDIR)/*.ml[ily] \
$(ED_DIR)/*.ml $(ED_DIR)/*.mli
headache \
-c misc/headache_config.txt \
-h $(DGRAPH_DIR)/headers/CEA_LGPL \
$(DGRAPH_DIR)/*.ml $(DGRAPH_DIR)/*.mli
# export
########
EXPORTDIR=$(NAME)-$(VERSION)
TAR=$(EXPORTDIR).tar
FTP = /users/www-perso/projets/ocamlgraph/download
WWW = /users/www-perso/projets/ocamlgraph
FILES = src/*.ml* lib/*.ml* Makefile.in configure configure.in META.in \
.depend editor/ed_*.ml* editor/Makefile \
editor/tests/*.dot editor/tests/*.gml \
view_graph/*.ml view_graph/*.mli \
view_graph/README view_graph/Makefile \
dgraph/*.ml dgraph/*.mli \
examples/*.ml tests/*.ml \
README FAQ CREDITS INSTALL COPYING LICENSE CHANGES
export: source export-doc export-web export-delaunay
source:
mkdir -p export
cd export; rm -rf $(EXPORTDIR)
mkdir -p export/$(EXPORTDIR)/bin
cp --parents $(FILES) export/$(EXPORTDIR)
cd export ; tar cf $(TAR) $(EXPORTDIR) ; gzip -f --best $(TAR)
cp export/$(TAR).gz $(FTP)
cp README FAQ CREDITS COPYING LICENSE CHANGES $(EXAMPLES) $(FTP)
# Build and install the .tar.gz requiered by Frama-C
framac: EXPORTDIR=ocamlgraph
framac: FTP=$$HOME/frama-c
framac:
mkdir -p export
cd export; rm -rf $(EXPORTDIR)
mkdir -p export/$(EXPORTDIR)/bin
cp --parents $(FILES) export/$(EXPORTDIR)
cd export ; tar cf $(TAR) $(EXPORTDIR) ; gzip -f --best $(TAR)
cp export/$(TAR).gz $(FTP)
make -C $(FTP) force-ocamlgraph
www/version.prehtml: Makefile.in
echo "<#def version>$(VERSION)</#def>" > www/version.prehtml
export-web: www/version.prehtml
make -C www install
export-doc: $(DOC_CMO)
rm -f $(WWW)/doc/*
-$(OCAMLDOC) -d $(WWW)/doc -html $(DGRAPH_INCLUDES) $(DOC_SRC)
MISCFTP = $(HOME)/WWW/ftp/ocaml/misc
DELAUNAY=delaunay.ml delaunay.mli
export-delaunay:
cd src; cp -f $(DELAUNAY) $(MISCFTP)
cd src; rm -f delaunay.annot; caml2html -noannot -d $(MISCFTP) $(DELAUNAY)
# generic rules
###############
.SUFFIXES: .mli .ml .cmi .cmo .cmx .mll .mly .tex .dvi .ps .html
.mli.cmi:
$(OCAMLC) -c $(BFLAGS) $<
.ml.cmo:
$(OCAMLC) -c $(BFLAGS) $<
.ml.o:
$(OCAMLOPT) -c $(OFLAGS) $<
.ml.cmx:
$(OCAMLOPT) -c $(OFLAGS) $<
.mll.ml:
$(OCAMLLEX) $<
.mly.ml:
$(OCAMLYACC) -v $<
.mly.mli:
$(OCAMLYACC) -v $<
.tex.dvi:
latex $< && latex $<
.dvi.ps:
dvips $< -o $@
.tex.html:
hevea $<
# Emacs tags
############
otags:
otags -r src editor view_graph
tags:
find . -name "*.ml*" | sort -r | xargs \
etags "--regex=/let[ \t]+\([^ \t]+\)/\1/" \
"--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \
"--regex=/and[ \t]+\([^ \t]+\)/\1/" \
"--regex=/type[ \t]+\([^ \t]+\)/\1/" \
"--regex=/exception[ \t]+\([^ \t]+\)/\1/" \
"--regex=/val[ \t]+\([^ \t]+\)/\1/" \
"--regex=/module[ \t]+\([^ \t]+\)/\1/"
# Makefile is rebuilt whenever Makefile.in or configure.in is modified
######################################################################
Makefile: Makefile.in config.status
if test -e $@; then chmod a+w $@; fi
./config.status
chmod a-w $@
config.status: configure
./config.status --recheck
configure: configure.in
autoconf
# clean
#######
clean:
rm -f *~
for d in $(SRCDIR) $(LIBDIR) $(ED_DIR) $(VIEWER_DIR) $(DGRAPH_DIR) \
tests examples; \
do \
rm -f $$d/*.cm[iox] $$d/*$(OBJEXT) $$d/*~ $$d/*.annot; \
done
rm -f $(GENERATED) $(SRCDIR)/dot_parser.output
rm -f graph.*a graph.cm* graph.o graph$(LIBEXT)
rm -f $(ED_DIR)/editor.byte $(ED_DIR)/editor.opt
rm -f $(VIEWER_DIR)/viewgraph.byte $(VIEWER_DIR)/viewgraph.opt
rm -f $(DGRAPH_DIR)/dgraph.byte $(DGRAPH_DIR)/dgraph.opt
rm -f $(DGRAPH_DIR)/dgraph
rm -f *.haux *.aux *.log $(NAME).tex $(NAME).dvi $(DOCFILES)
rm -f $(EXAMPLESBIN)
dist-clean distclean:: clean
rm -f Makefile config.cache config.log config.status *.byte *.opt
svnclean svn-clean:: dist-clean
rm -f config.* configure configure.lineno
# depend
########
.PHONY: depend
.depend depend: $(GENERATED)
rm -f .depend
$(OCAMLDEP) $(INCLUDES) -I $(ED_DIR) -I $(VIEWER_DIR) -I $(DGRAPH_DIR)\
$(LIBDIR)/*.ml $(LIBDIR)/*.mli \
$(SRCDIR)/*.ml $(SRCDIR)/*.mli \
$(ED_DIR)/*.mli $(ED_DIR)/*.ml \
$(VIEWER_DIR)/*.mli $(VIEWER_DIR)/*.ml \
$(DGRAPH_DIR)/*.mli $(DGRAPH_DIR)/*.ml > .depend
include .depend