forked from backtracking/bibtex2html
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
366 lines (275 loc) · 9.99 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
##########################################################################
# bibtex2html - A BibTeX to HTML translator #
# Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché #
# #
# This software is free software; you can redistribute it and/or #
# modify it under the terms of the GNU General Public #
# License version 2, as published by the Free Software Foundation. #
# #
# 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. #
# #
# See the GNU General Public License version 2 for more details #
# (enclosed in the file GPL). #
##########################################################################
#########################################
# Configuration part
#########################################
# where to put executable files
prefix=@prefix@
exec_prefix=@exec_prefix@
BINDIR=@bindir@
EXE=@EXE@
# where to install the man pages
MANDIR = @mandir@
# where to install the doc
DOCDIR = $(prefix)/doc/bibtex2html
# only used in target 'binary', only on Linux machines these days
OSTYPE=linux
#########################################
# End of configuration part
#########################################
VERSION=1.99
OCAMLC = @OCAMLC@
OCAMLOPT = @OCAMLOPT@
CAMLDEP = @OCAMLDEP@
OCAMLLEX = @OCAMLLEX@
ZLIBS =
DEBUG =
FLAGS = $(ZLIBS) $(DEBUG)
PROFILE =
STRLIB =
OBJS = options.cmx html.cmx latexmacros.cmx latexscan.cmx bbl_lexer.cmx \
bibtex.cmx bibtex_parser.cmx bibtex_lexer.cmx \
readbib.cmx expand.cmx bibfilter.cmx \
biboutput.cmx version.cmx translate.cmx \
copying.cmx main.cmx
BIB2BIBOBJS = options.cmx bibtex.cmx bibtex_lexer.cmx \
bibtex_parser.cmx readbib.cmx \
latex_accents.cmx condition.cmx \
condition_parser.cmx condition_lexer.cmx parse_condition.cmx \
bibfilter.cmx latexmacros.cmx latexscan.cmx expand.cmx \
html.cmx biboutput.cmx version.cmx copying.cmx bib2bib.cmx
all: @OCAMLBEST@ doc-@enable_doc@
opt: bibtex2html$(EXE) bib2bib$(EXE)
byte: bibtex2html.byte bib2bib.byte
.PHONY: bench
bench: bibtex2html
cd bench; sh bench
test: bibtex2html bib2bib
./bib2bib$(EXE) test.bib
./bibtex2html$(EXE) test.bib
@echo "test passed successfully"
install-indep:
mkdir -p $(BINDIR)
cp aux2bib $(BINDIR)/aux2bib
mkdir -p $(MANDIR)/man1
cp bibtex2html.1 $(MANDIR)/man1/bibtex2html.1
cp bibtex2html.1 $(MANDIR)/man1/bib2bib.1
cp aux2bib.1 $(MANDIR)/man1/aux2bib.1
install: install-indep
if test @OCAMLBEST@ = opt ; then \
cp bibtex2html bib2bib $(BINDIR) ; \
else \
cp bibtex2html.byte $(BINDIR)/bibtex2html ; \
cp bib2bib.byte $(BINDIR)/bib2bib ; \
fi
uninstall:
rm -f $(BINDIR)/aux2bib $(BINDIR)/bibtex2html $(BINDIR)/bib2bib
rm -f $(MANDIR)/man1/aux2bib.1 $(MANDIR)/man1/bibtex2html.1 \
$(MANDIR)/man1/bib2bib.1
install-byte: install-indep
cp bibtex2html.byte $(BINDIR)/bibtex2html
cp bib2bib.byte $(BINDIR)/bib2bib
win: bibtex2html$(EXE) bib2bib$(EXE) bibtex2html.nsi
"/cygdrive/c/Program Files (x86)/NSIS/makensis" /DVERSION=$(VERSION) bibtex2html.nsi
local: bibtex2html bib2bib
cp bibtex2html bib2bib aux2bib $$HOME/bin/$(OSTYPE)
cp *.1 $$HOME/man/man1
demons: bibtex2html bib2bib
cp bibtex2html bib2bib aux2bib /users/demons/demons/bin/$(OSTYPE)
cp *.1 $$HOME/man/man1
bibtex2html$(EXE): $(OBJS)
$(OCAMLOPT) $(PROFILE) $(FLAGS) -o bibtex2html$(EXE) str.cmxa $(OBJS) $(STRLIB)
strip bibtex2html$(EXE)
bibtex2html.byte: $(OBJS:.cmx=.cmo)
$(OCAMLC) $(PROFILE) $(FLAGS)-o bibtex2html.byte str.cma $(OBJS:.cmx=.cmo) $(STRLIB)
bibtex2html.pbyte: $(OBJS:.cmx=.cmo)
$(OCAMLC) -use-runtime ~demons/bin/$(OSTYPE)/ocamlcustomrun \
-o bibtex2html.pbyte str.cma $(OBJS:.cmx=.cmo)
bibtex2html.static: $(OBJS)
$(OCAMLOPT) $(PROFILE) $(FLAGS) -o $@ str.cmxa $(OBJS) $(STRLIB) -cclib "-L. -static"
strip $@
SRC=$(OBJS:.cmx=.ml)
bibtex2html.dfc: $(SRC)
ocamldefun -d defun `ocamldefun-args $(SRC)`
cd defun; $(OCAMLOPT) $(FLAGS) -o ../$@ str.cmxa $(SRC)
bib2bib$(EXE): $(BIB2BIBOBJS)
$(OCAMLOPT) $(PROFILE) $(FLAGS) -o bib2bib$(EXE) str.cmxa $(BIB2BIBOBJS) $(STRLIB)
strip bib2bib$(EXE)
bib2bib.byte: $(BIB2BIBOBJS:.cmx=.cmo)
$(OCAMLC) $(PROFILE) $(FLAGS) -o bib2bib.byte str.cma $(BIB2BIBOBJS:.cmx=.cmo) $(STRLIB)
bib2bib.pbyte: $(BIB2BIBOBJS:.cmx=.cmo)
$(OCAMLC) -use-runtime ~demons/bin/$(OSTYPE)/ocamlcustomrun \
-o bib2bib.pbyte str.cma $(BIB2BIBOBJS:.cmx=.cmo)
bib2bib.static: $(BIB2BIBOBJS)
$(OCAMLOPT) $(PROFILE) $(FLAGS) -o $@ str.cmxa $(BIB2BIBOBJS) $(STRLIB) -cclib "-L. -static"
strip $@
static: bibtex2html.static bib2bib.static
cp bibtex2html.static $$HOME/bin/$(OSTYPE)/bibtex2html
cp bib2bib.static $$HOME/bin/$(OSTYPE)/bib2bib
bibtex_parser.mli bibtex_parser.ml: bibtex_parser.mly
ocamlyacc bibtex_parser.mly
condition_parser.mli condition_parser.ml: condition_parser.mly
ocamlyacc condition_parser.mly
ifdef SOURCE_DATE_EPOCH
BUILD_DATE=$(shell date -u -d "@$(SOURCE_DATE_EPOCH)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" 2>/dev/null || date)
else
BUILD_DATE=$(shell date)
endif
version.ml: Makefile
echo "let version = \""$(VERSION)"\"" > $@
echo 'let date = "'"$(BUILD_DATE)"'"' >> $@
version.tex: Makefile
printf "\\\newcommand{\\\version}{$(VERSION)}" > version.tex
latexscan.ml: latexscan.mll
$(OCAMLLEX) latexscan.mll
bibtex_lexer.ml: bibtex_lexer.mll
$(OCAMLLEX) bibtex_lexer.mll
# file headers
##############
headers:
headache -c header_config.txt -h common_header.txt \
Makefile.in configure.in README \
*.ml *.ml[ily4] manual.tex \
bibtex2html.nsi
# aux2bib.in ?
# literate programming
######################
lp: bibtex2html.dvi
WEBFILES=options.mli options.ml latexmacros.mli latexmacros.ml \
latexscan.mll bbl_lexer.mll \
bibtex.mli bibtex.ml bibtex_lexer.mll bibtex_parser.mly \
readbib.mli readbib.ml expand.mli expand.ml \
bibfilter.mli bibfilter.ml \
html.ml biboutput.mli biboutput.ml version.mli \
translate.mli translate.ml copying.mli copying.ml main.ml
bibtex2html.tex: $(WEBFILES)
ocamlweb -o $@ $(WEBFILES)
.SUFFIXES: .tex .dvi .pdf
.tex.dvi:
latex $< && latex $<
.tex.pdf:
pdflatex $< && pdflatex $<
# export
########
NAME=bibtex2html-$(VERSION)
FTP = /users/demons/filliatr/ftp/ocaml/bibtex2html
WWWSRC = /users/demons/filliatr/www/bibtex2html
SOURCEFILES = *.ml* aux2bib.in Makefile.in configure.in configure .depend README COPYING GPL CHANGES manual.tex *.1 test.bib
export: source export-doc linux
echo "<#def version>$(VERSION)</#def>" > $(WWWSRC)/version.prehtml
make -C $(WWWSRC) install
mail -s "nouvelle release de bibtex2html" [email protected] < /dev/null
mail -s "new release of bibtex2html" [email protected] < /dev/null
echo "*** prevenir Gerald Pfeifer <[email protected]> ***"
move-olds:
cp $(FTP)/bibtex2html* $(FTP)/olds
source: clean
mkdir -p export/$(NAME)
cp $(SOURCEFILES) export/$(NAME)
(cd export ; tar cf $(NAME).tar $(NAME) ; \
gzip -f --best $(NAME).tar)
if test -f $(FTP)/$(NAME).tar.gz && \
! cmp -s export/$(NAME).tar.gz $(FTP)/$(NAME).tar.gz; then \
echo "IL FAUT CHANGER DE NUMÉRO DE VERSION"; exit 1; \
fi
cp README COPYING GPL CHANGES export/$(NAME).tar.gz $(FTP)
BINARY = bibtex2html-$(VERSION)-$(OSTYPE)
linux: clean binary
solaris:
ssh sun-graphe make -C $(HOME)/soft/ocaml/bibtex clean binary
sunos4:
rmake ??? $(HOME)/soft/ocaml/bibtex clean binary
BINARYFILES = README COPYING GPL bibtex2html bib2bib aux2bib \
bibtex2html.1 bib2bib.1 aux2bib.1
binary: bibtex2html bib2bib
mkdir -p export/$(BINARY)
cp $(BINARYFILES) export/$(BINARY)
(cd export; tar czf $(BINARY).tar.gz $(BINARY))
cp export/$(BINARY).tar.gz $(FTP)
AIX=bibtex2html-$(VERSION)-AIX
aix:
mkdir -p export/$(AIX)
cp $(BINARYFILES) export/$(AIX)
(cd export; tar cf $(AIX).tar $(AIX); gzip --best $(AIX).tar)
# documentation
###############
WWW=/users/demons/filliatr/WWW/bibtex2html
doc-yes: doc
doc-no:
doc: manual.pdf manual.html
install-doc: manual.pdf manual.html
mkdir -p $(DOCDIR)
cp -f manual.pdf $(DOCDIR)
cp -f manual.html $(DOCDIR)
export-doc: manual.pdf manual.html
cp -f manual.pdf $(WWW)/doc
cp -f manual.html $(WWW)/doc
manual.pdf: version.tex manual.tex
pdflatex manual.tex
pdflatex manual.tex
manual.html: version.tex manual.tex
hevea -exec xxdate.exe -fix manual.tex
# generic rules :
#################
.SUFFIXES: .mli .ml .mll .cmi .cmo .cmx
.mli.cmi:
$(OCAMLC) -c $(FLAGS) $<
.ml.cmo:
$(OCAMLC) -c $(FLAGS) $<
.ml.o:
$(OCAMLOPT) -c $(FLAGS) $<
.ml.cmx:
$(OCAMLOPT) -c $(PROFILE) $(FLAGS) $<
.mll.ml:
$(OCAMLLEX) $<
# 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/"
# myself
Makefile: Makefile.in config.status
./config.status
config.status: configure
./config.status --recheck
configure: configure.in
autoconf
# clean and depend
##################
GENERATED = bibtex_lexer.ml bbl_lexer.ml \
latexscan.ml latex_accents.ml condition_lexer.ml \
bibtex_parser.mli bibtex_parser.ml \
condition_parser.mli condition_parser.ml version.ml version.tex
clean::
rm -f *~ *.cm[iox] *.o
rm -f $(GENERATED)
rm -f bibtex2html bib2bib
rm -f manual.aux manual.log manual.dvi manual.pdf
rm -f manual.toc manual.haux manual.html manual.htoc
rm -f bibtex2html.static bib2bib.static
rm -f bibtex2html.byte bib2bib.byte
distclean:: clean
rm -f Makefile aux2bib
depend:: $(GENERATED)
rm -f .depend
ocamldep $(ZLIBS) *.mli *.ml > .depend
include .depend