File: Makefile.in

package info (click to toggle)
ocamlviz 1.01-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,168 kB
  • sloc: ml: 5,734; makefile: 199
file content (304 lines) | stat: -rw-r--r-- 7,862 bytes parent folder | download
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
##########################################################################
#                                                                        #
#  Ocamlviz --- real-time profiling tools for Objective Caml             #
#  Copyright (C) by INRIA - CNRS - Universite Paris Sud                  #
#  Authors: Julien Robert                                                #
#           Guillaume Von Tokarski                                       #
#           Sylvain Conchon                                              #
#           Jean-Christophe Filliatre                                    #
#           Fabrice Le Fessant                                           #
#  GNU Library General Public License version 2                          #
#  See file LICENSE for details                                          #
#                                                                        #
##########################################################################

#
# sample Makefile for Objective Caml
# Copyright (C) 2001 Jean-Christophe FILLIATRE
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License version 2, as published by the Free Software Foundation.
# 
# This library 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.
# 
# See the GNU Library General Public License version 2 for more details
# (enclosed in the file LGPL).

# where to install the binaries
prefix=@prefix@
exec_prefix=@exec_prefix@
BINDIR=@bindir@

# where to install the man page
MANDIR=@mandir@

# other variables set by ./configure
OCAMLC   = @OCAMLC@
OCAMLOPT = @OCAMLOPT@
OCAMLDEP = @OCAMLDEP@
OCAMLLEX = @OCAMLLEX@
OCAMLYACC= @OCAMLYACC@
OCAMLLIB = @OCAMLLIB@
OCAMLBEST= @OCAMLBEST@
OCAMLVERSION = @OCAMLVERSION@
OCAMLWEB = @OCAMLWEB@
OCAMLWIN32 = @OCAMLWIN32@
EXE = @EXE@

INCLUDES = -I src -I +threads @INCLUDEGTK2@ @INCLUDECAIRO@
BFLAGS = -g -unsafe-string -dtypes $(INCLUDES)
OFLAGS = -unsafe-string -dtypes $(INCLUDES)

# main target
#############

NAME = ocamlviz

all: $(OCAMLBEST)

byte: ascii.byte libocamlviz.cma camlp4/pa_ocamlviz.cmo

opt: ascii.opt libocamlviz.cma libocamlviz.cmxa camlp4/pa_ocamlviz.cmo @GUIOPT@

# bytecode and native-code compilation
######################################


GENERATED = src/version.ml src/preflexer.ml

PROTOCOLCMO = src/binary.cmo src/bproto.cmo 
PROTOCOLCMX = $(PROTOCOLCMO:.cmo=.cmx)

OCAMLVIZCMO = $(PROTOCOLCMO) src/monitor_impl.cmo src/ocamlviz.cmo src/ocamlviz_threads.cmo 
OCAMLVIZCMX = $(OCAMLVIZCMO:.cmo=.cmx)

LIBOCAMLVIZ = libocamlviz.cmxa
LIBOCAMLVIZBYTE = libocamlviz.cma

$(LIBOCAMLVIZ): $(OCAMLVIZCMX)
	$(OCAMLOPT) -a $(OFLAGS) -o $@ $^

$(LIBOCAMLVIZBYTE): $(OCAMLVIZCMO)
	$(OCAMLC) -a $(BFLAGS) -thread -o $@ threads.cma $^


CLIENTCMO = $(PROTOCOLCMO) src/timemap.cmo src/db.cmo src/options.cmo src/net.cmo
CLIENTCMX = $(CLIENTCMO:.cmo=.cmx)

ASCIICMO = $(CLIENTCMO) src/ascii.cmo
ASCIICMX = $(ASCIICMO:.cmo=.cmx)

ascii.byte: $(ASCIICMO)
	$(OCAMLC) -thread $(BFLAGS) -o $@ unix.cma threads.cma $^

ascii.opt: $(ASCIICMX) 
	$(OCAMLOPT) -thread $(OFLAGS) -o $@ unix.cmxa threads.cmxa $^ 


TREEPANELCMO = $(CLIENTCMO) src/dot.cmo src/tree_panel.cmo
TREEPANELCMX = $(TREEPANELCMO:.cmo=.cmx)

GUICMO = $(TREEPANELCMO) src/graph.cmo src/preflexer.cmo src/gui_misc.cmo src/gui_models.cmo src/gui_views.cmo src/gui_pref.cmo src/gui.cmo 
GUICMX = $(GUICMO:.cmo=.cmx)

gui.byte: $(GUICMO)
	$(OCAMLC) $(BFLAGS) -o $@ lablgtk.cma gtkInit.cma unix.cma $^

gui.opt: $(GUICMX) 
	$(OCAMLOPT) $(OFLAGS) -o $@ unix.cmxa threads.cmxa lablgtk.cmxa cairo.cmxa cairo_lablgtk.cmxa gtkThread.cmx $^


camlp4/pa_ocamlviz.cmo: camlp4/pa_ocamlviz.ml 
	ocamlc -c -dtypes -I +camlp4 -I +str -pp camlp4of str.cma $^

tests/pa-%.ml: tests/%.ml camlp4/pa_ocamlviz.cmo 
	camlp4 pa_o.cmo str.cma camlp4/pa_ocamlviz.cmo pr_o.cmo tests/$*.ml -o tests/pa-$*.ml

test-%: tests/%.opt gui.opt
	xterm -e "tests/$*.opt 100" &
	sleep 1 && ./gui.opt

test-%-byte: tests/%.byte gui.opt
	xterm -e "tests/$*.byte 100" &
	sleep 1 && ./gui.opt

ascii-%: tests/%.opt ascii.opt
	xterm -e "tests/$*.opt 100" &
	sleep 1 && ./ascii.opt 

tests/%.opt: $(LIBOCAMLVIZ) tests/%.ml
	$(OCAMLOPT) -thread $(OFLAGS) -o $@ unix.cmxa threads.cmxa $^

tests/%.byte: $(LIBOCAMLVIZBYTE) tests/%.ml
	$(OCAMLC) -thread -I src -o $@ unix.cma threads.cma $^


VERSION=0.1

src/version.ml: Makefile
	echo "let version = \""$(VERSION)"\"" > $@
	echo "let date = \""`date`"\"" >> $@

# installation
##############

install-indep: 
	mkdir -p $(BINDIR)
	mkdir -p $(MANDIR)/man1
	cp -f doc/ocamlviz.1 $(MANDIR)/man1/ocamlviz.1

install: install-indep install-$(OCAMLBEST)
	cp -f src/ocamlviz.mli src/ocamlviz.cmi src/ocamlviz_threads.cmi $(OCAMLLIB)
	cp -f libocamlviz.cma $(OCAMLLIB)
	cp -f camlp4/pa_ocamlviz.cmi camlp4/pa_ocamlviz.cmo $(OCAMLLIB)/camlp4
	cp -f ascii.$(OCAMLBEST) $(BINDIR)/ocamlviz-ascii

install-byte:

install-opt:
	cp -f libocamlviz.cmxa libocamlviz.a $(OCAMLLIB)
	cp -f gui.$(OCAMLBEST) $(BINDIR)/ocamlviz-gui



# documentation
###############

DOCFILES=doc/index.html 

.PHONY: doc/index.html

.PHONY: doc/manual.pdf

doc: $(DOCFILES)

# OCAMLDOCFILES=$(filter-out src/monitor_sig.mli, $(wildcard src/*.mli))
OCAMLDOCFILES=src/*.mli

doc/index.html:
	ocamldoc -html -d doc -I src -I +lablgtk2 $(OCAMLDOCFILES)

doc/manual.pdf: doc/manual.tex
	cd doc && mlpost -latex manual.tex -pdf fig.ml && pdflatex manual.tex

wc:
	ocamlwc src/*.ml* tests/*.ml* www/*.html -p 

# export
########

EXPORTDIR=$(NAME)-$(VERSION)
TAR=$(EXPORTDIR).tar

FTP = $$HOME/ftp/$(NAME)
WWW = $$HOME/WWW/$(NAME)

FILES = *.ml* $(NAME).1 manual.tex	     \
	Makefile.in configure configure.in   \
	.depend README INSTALL COPYING GPL CHANGES


# literate programming
######################

SOURCES = 

$(NAME).tex: $(SOURCES)
	$(OCAMLWEB) -o $@ $^

# 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
############

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/"

# file headers
##############
headers:
	headache -c doc/headache_config.txt -h doc/header.txt \
		Makefile.in configure.in README \
		*/*.ml */*.ml[ily4] doc/*.tex

# Makefile is rebuilt whenever Makefile.in or configure.in is modified
######################################################################

Makefile: Makefile.in config.status
	./config.status

config.status: configure
	./config.status --recheck

configure: configure.in
	autoconf 

# clean
#######

clean::
	rm -f src/*.cm[iox] src/*.o src/*~ src/*.annot 
	rm -f tests/*.cm[iox] tests/*.o tests/*~ tests/*.annot tests/*.byte tests/*.opt
	rm -f $(GENERATED) 
	rm -f *.byte *.opt
	rm -f libocamlviz.*
	rm -f doc/*.html doc/*mps doc/*.aux doc/*.bbl doc/*.blg 		
	rm -f doc/*.log doc/*.toc doc/*.vrb doc/*.snm doc.*.out doc/*.nav

dist-clean distclean:: clean
	rm -f Makefile config.cache config.log config.status

# depend
########

dep:
	ocamldep -I src src/*.ml src/*.mli | ocamldot | dot -Tps | gv -

.depend depend:: $(GENERATED)
	rm -f .depend
	$(OCAMLDEP) $(INCLUDES) src/*.ml src/*.mli > .depend

include .depend