File: Makefile.in

package info (click to toggle)
mlpost 0.8.1-8
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,808 kB
  • ctags: 2,934
  • sloc: ml: 17,440; makefile: 469
file content (324 lines) | stat: -rw-r--r-- 9,809 bytes parent folder | download | duplicates (4)
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
##########################################################################
#                                                                        #
#  Copyright (C) Johannes Kanig, Stephane Lescuyer                       #
#  Jean-Christophe Filliatre, Romain Bardou and Francois Bobot           #
#                                                                        #
#  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.                  #
#                                                                        #
##########################################################################

#common variables set by configure script
############################################

# where to install the binaries
prefix=@prefix@
datarootdir = @datarootdir@
datadir = @datadir@
exec_prefix=@exec_prefix@
BINDIR=@bindir@
LIBDIR=@LIBDIR@
USEOCAMLFIND=@USEOCAMLFIND@
OCAMLFIND=@OCAMLFIND@
OCAMLBUILDBIN=@OCAMLBUILD@

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

PSVIEWER=@PSVIEWER@
PDFVIEWER=@PDFVIEWER@

# other variables set by ./configure
OCAMLC   = @OCAMLC@
OCAMLOPT = @OCAMLOPT@
OCAMLDEP = @OCAMLDEP@
OCAMLLEX = @OCAMLLEX@
OCAMLYACC= @OCAMLYACC@
#(not used) OCAMLLIB = @OCAMLLIB@
OCAMLBEST= @OCAMLBEST@
OCAMLVERSION = @OCAMLVERSION@
OCAMLWEB = @OCAMLWEB@
OCAMLWIN32 = @OCAMLWIN32@
EXE = @EXE@
LIBEXT = @LIBEXT@
OBJEXT = @OBJEXT@
TAGS = @TAGS@

INCLUDES = -I gui -I +threads @INCLUDEGTK2@
BFLAGS = -dtypes $(INCLUDES)
OFLAGS = -g -dtypes $(INCLUDES) -for-pack Mlpost

LABLGTK2 = @LABLGTK2@
LABLGTK2LIB = @LABLGTK2LIB@

CAIROLABLGTK2 = @CAIROLABLGTK2@
CAIROLABLGTK2LIB = @CAIROLABLGTK2LIB@

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

NAME = mlpost
MLPOSTVERSION=@PACKAGE_VERSION@

# decide which Makefile to use
include ocamlbuild.Makefile

# common part of both Makefiles
##################################
# misc
######
dep:
	$(OCAMLDEP) *.mli *.ml | ocamldot | dot -Tps | $(PSVIEWER) -

wc:
	ocamlwc *.ml* backend/*.ml* -p

man:
	nroff -Tascii -mandoc mlpost.1 | less

# headers
#########

headers:
	headache -c headache_config.txt -h header.txt \
	 *.in README.txt *.mli *.ml *.mll backend/*.ml backend/*.ml[iyl]
	./config.status

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

install: install-$(OCAMLBEST) install-bin

install-contrib : install-$(OCAMLBEST)-contrib
install-byte-contrib: install-byte-dot install-byte-lablgtk
install-opt-contrib: install-opt-dot install-opt-lablgtk


BCMA = $(addprefix $(BUILD), $(CMA))
BCMXA = $(addprefix $(BUILD), $(CMXA) $(OBJ))

ifeq "@USEOCAMLFIND@" "no"
install-byte:
	mkdir -p $(LIBDIR)
	cp -f $(BUILD)mlpost.cmi META $(BCMA) "$(LIBDIR)"

install-opt:
	mkdir -p $(LIBDIR)
	cp -f $(BUILD)mlpost.cmi META $(BCMA) "$(LIBDIR)"
	cp -f $(BUILD)mlpost$(LIBEXT) $(BCMXA) "$(LIBDIR)"

install-byte-dot:
	mkdir -p $(LIBDIR)_dot
	cp -f contrib/dot/META "$(LIBDIR)_dot"
	cp -f $(addprefix contrib/dot/_build/mlpost_dot,.cmi .cma) "$(LIBDIR)_dot"

install-opt-dot:
	mkdir -p $(LIBDIR)_dot
	cp -f contrib/dot/META "$(LIBDIR)_dot"
	cp -f $(addprefix contrib/dot/_build/mlpost_dot,.cmi .cma .cmxa $(LIBEXT)) "$(LIBDIR)_dot"

ifeq "$(LABLGTK2)$(CAIROLABLGTK2)$(USEOCAMLFIND)" "yesyesyes"

install-byte-lablgtk:
	mkdir -p $(LIBDIR)_lablgtk
	cp -f contrib/lablgtk/META "$(LIBDIR)_lablgtk"
	cp -f $(addprefix contrib/lablgtk/_build/mlpost_lablgtk,.cmi .cma) "$(LIBDIR)_lablgtk"

install-opt-lablgtk:
	mkdir -p $(LIBDIR)_lablgtk
	cp -f contrib/lablgtk/META "$(LIBDIR)_lablgtk"
	cp -f $(addprefix contrib/lablgtk/_build/mlpost_lablgtk,.cmi .cma .cmxa $(LIBEXT)) "$(LIBDIR)_lablgtk"

else
install-byte-lablgtk:

install-opt-lablgtk:

endif

else
DESTDIR=-destdir $(LIBDIR:/mlpost=)

install-byte:
	$(OCAMLFIND) remove $(DESTDIR) mlpost
	$(OCAMLFIND) install $(DESTDIR) mlpost $(BUILD)mlpost.cmi META $(BCMA)

install-opt:
	$(OCAMLFIND) remove $(DESTDIR) mlpost
	$(OCAMLFIND) install $(DESTDIR) mlpost $(BUILD)mlpost$(LIBEXT) $(BUILD)mlpost.cmi META $(BCMXA) $(BCMA)


install-byte-dot:
	$(OCAMLFIND) remove $(DESTDIR) mlpost_dot
	$(OCAMLFIND) install $(DESTDIR) mlpost_dot contrib/dot/META \
	   $(addprefix contrib/dot/_build/mlpost_dot,.cmi .cma)

install-opt-dot:
	$(OCAMLFIND) remove $(DESTDIR) mlpost_dot
	$(OCAMLFIND) install $(DESTDIR) mlpost_dot contrib/dot/META \
           $(addprefix contrib/dot/_build/mlpost_dot,.cmi .cma .cmxa $(LIBEXT))

ifeq "$(LABLGTK2)$(CAIROLABLGTK2)$(USEOCAMLFIND)" "yesyesyes"
install-byte-lablgtk:
	$(OCAMLFIND) remove $(DESTDIR) mlpost_lablgtk
	$(OCAMLFIND) install $(DESTDIR) mlpost_lablgtk contrib/lablgtk/META \
	   $(addprefix contrib/lablgtk/_build/mlpost_lablgtk,.cmi .cma)

install-opt-lablgtk:
	$(OCAMLFIND) remove $(DESTDIR) mlpost_lablgtk
	$(OCAMLFIND) install $(DESTDIR) mlpost_lablgtk contrib/lablgtk/META \
           $(addprefix contrib/lablgtk/_build/mlpost_lablgtk,.cmi .cma .cmxa $(LIBEXT))
else
install-byte-lablgtk:

install-opt-lablgtk:

endif

endif

install-byte-contrib: install-byte-dot install-byte-lablgtk


install-bin:
	mkdir -p $(BINDIR) $(MANDIR)/man1
	cp -f $(BUILD)$(TOOL) $(BINDIR)/mlpost
	cp -f mlpost.1 $(MANDIR)/man1

ifeq "@USEOCAMLFIND@" "no"
uninstall: uninstall-contrib
	rm -rf $(LIBDIR)
	rm -f $(BINDIR)/mlpost
	rm -f $(MANDIR)/mlpost
else
uninstall: uninstall-contrib
	$(OCAMLFIND) remove $(DESTDIR) mlpost
	rm -f $(BINDIR)/mlpost
	rm -f $(MANDIR)/mlpost
endif

ifeq "@USEOCAMLFIND@" "no"
uninstall-contrib:
	rm -rf $(LIBDIR)/mlpost_lablgtk
	rm -rf $(LIBDIR)/mlpost_dot
else
uninstall-contrib:
	$(OCAMLFIND) remove $(DESTDIR) mlpost_dot
	$(OCAMLFIND) remove $(DESTDIR) mlpost_lablgtk
endif



# export
########

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

WWW = /users/www-perso/projets/mlpost
FTP = $(WWW)/download

FILES := $(wildcard *.ml) $(wildcard *.mli) $(wildcard *.mll) \
	 $(wildcard *.in) configure README.txt INSTALL LICENSE CHANGES FAQ \
	 mlpost.1 _tags *.mlpack mlpost_yeslablgtk.odocl mlpost_nolablgtk.odocl ocamlbuild.Makefile
BACKENDFILES = backend/*ml backend/*mli backend/_tags
DVIFILES = dvi/*mly dvi/*mll dvi/*ml dvi/*mli dvi/_tags
CONCRETEFILES = concrete/*ml concrete/*mli concrete/_tags
GENERATEDSOURCEFILES = version.ml myocamlbuild.ml $(GENERATED)
GUIFILES = gui/*.mll gui/*.ml gui/_tags
EXFILES = examples/Makefile examples/*.ml examples/all.template\
	  examples/index.html examples/parse.mll examples/README\
	  examples/prototype.js examples/style.css \
	  examples/powered-by-caml.128x58.png

CONTRIBDOTFILES = $(addprefix contrib/dot/, dot.ml dot.mli Makefile META mlpost_dot.mli mlpost_dot.mlpack _tags xdot_ast.mli xdot_lexer.mll xdot_parser.mly)
CONTRIBLABLGTKFILES = $(addprefix contrib/lablgtk/, META mlpost_lablgtk.ml mlpost_lablgtk.mli)
CUSTOMDOCFILES = customdoc/all.template customdoc/img_doc.ml customdoc/img.ml \
		 customdoc/Makefile customdoc/_tags
LATEXFILES = latex/*sty latex/*tex latex/README

export: export-source export-www export-examples export-doc
	cp README.txt INSTALL LICENSE CHANGES FAQ $(FTP)

export-source: source
	cp export/$(TAR).gz $(FTP)

source:
	mkdir -p export/$(EXPORTDIR)
	cp $(filter-out $(GENERATEDSOURCEFILES), $(FILES)) export/$(EXPORTDIR)
	mkdir -p export/$(EXPORTDIR)/backend
	cp $(BACKENDFILES) export/$(EXPORTDIR)/backend
	mkdir -p export/$(EXPORTDIR)/dvi
	cp $(DVIFILES) export/$(EXPORTDIR)/dvi
	mkdir -p export/$(EXPORTDIR)/concrete
	cp $(CONCRETEFILES) export/$(EXPORTDIR)/concrete
	mkdir -p export/$(EXPORTDIR)/gui
	cp $(GUIFILES) export/$(EXPORTDIR)/gui
	mkdir -p export/$(EXPORTDIR)/examples
	cp $(EXFILES) export/$(EXPORTDIR)/examples
	mkdir -p export/$(EXPORTDIR)/customdoc
	cp $(CUSTOMDOCFILES) export/$(EXPORTDIR)/customdoc
	mkdir -p export/$(EXPORTDIR)/latex
	cp $(LATEXFILES) export/$(EXPORTDIR)/latex
	mkdir -p export/$(EXPORTDIR)/contrib/dot
	mkdir -p export/$(EXPORTDIR)/contrib/lablgtk
	cp $(CONTRIBDOTFILES) export/$(EXPORTDIR)/contrib/dot
	cp $(CONTRIBLABLGTKFILES) export/$(EXPORTDIR)/contrib/lablgtk
	cd export ; tar cf $(TAR) $(EXPORTDIR) ; gzip -f --best $(TAR)


DOCFILES:=$(shell echo *.mli)
DOCFILES:=$(filter-out types.mli, $(DOCFILES))

export-doc: doc
	mkdir -p $(WWW)/doc/img
	cp doc/*.html doc/style.css $(WWW)/doc
	cp doc/img/*.png $(WWW)/doc/img

export-www: www/version.prehtml
	make -C www

www/version.prehtml: Makefile
	echo "<#def version>$(MLPOSTVERSION)</#def>" > www/version.prehtml

export-examples:
	$(MAKEEXAMPLES)
	cp -f --parents examples/*.png examples/*.html examples/*.svg examples/prototype.js examples/style.css $(WWW)

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

.PHONY: ocamlwizard
ocamlwizard:
	ocamlrun -bt ocamlwizard compile types.mli $(CMO:.cmo=.ml) mlpost.mli


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

Makefile META version.ml myocamlbuild.ml: Makefile.in META.in version.ml.in config.status myocamlbuild.ml.in
	./config.status
	chmod a-w myocamlbuild.ml META Makefile version.ml

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

configure: configure.in
	autoconf