more make vars for makeinfo
[gnulib.git] / doc / Makefile
1 # Makefile for gnulib doc.
2 # Copyright (C) 2004, 2006-2011 Free Software Foundation, Inc.
3 #
4 # Copying and distribution of this file, with or without modification,
5 # are permitted in any medium without royalty provided the copyright
6 # notice and this notice are preserved.
7
8 doc = gnulib
9
10 lang_env = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE=
11 makeinfo_prog = makeinfo
12 MAKEINFO = $(lang_env) $(makeinfo_prog)
13
14 manual_opts = --no-split --reference-limit=2000
15 TEXI2HTML = $(MAKEINFO) $(manual_opts) --html
16
17 %.info: %.texi
18         $(MAKEINFO) $(manual_opts) $<
19
20 %.html: %.texi
21         $(TEXI2HTML) -o $@ $<
22
23 %.dvi: %.texi
24         texi2dvi $< || { if texi2dvi $< 2>/dev/null | grep 'TeX capacity exceeded, sorry \[save size=' > /dev/null; then echo '*** You must increase the save_size in your texmf.cnf file, often located under /etc/texmf/.'; fi; exit 1; }
25
26 %.pdf: %.texi
27         texi2pdf $< || { if texi2pdf $< 2>/dev/null | grep 'TeX capacity exceeded, sorry \[save size=' > /dev/null; then echo '*** You must increase the save_size in your texmf.cnf file, often located under /etc/texmf/.'; fi; exit 1; }
28
29 all: info html dvi
30 info: $(doc).info
31 html: $(doc).html
32 dvi: $(doc).dvi
33 pdf: $(doc).pdf
34
35 INSTALL_PRELUDE = echo '@firstparagraphindent insert'
36
37 # INSTALL file with old ASCII quotation marks (looks ugly on modern machines).
38 INSTALL: install.texi
39         $(INSTALL_PRELUDE) | cat - $< > tmp.texi
40         $(MAKEINFO) --plaintext --no-validate tmp.texi > $@
41         rm -f tmp.texi
42
43 # INSTALL file with ISO 646 or ISO 8859 quotation marks.
44 INSTALL.ISO: install.texi
45         $(INSTALL_PRELUDE) | cat - $< > tmpi.texi
46         $(MAKEINFO) --plaintext --no-validate tmpi.texi \
47           | sed -e "s/\`\([^']*\)'/'\1'/g" > $@
48         rm -f tmpi.texi
49
50 # INSTALL file wit ISO 10646 (Unicode) quotation marks.
51 INSTALL.UTF-8: install.texi
52         $(INSTALL_PRELUDE) | cat - $< > tmpu.texi
53         $(MAKEINFO) --plaintext --no-validate tmpu.texi \
54           | sed -e "s/\`\([^']*\)'/‘\1’/g" > $@
55         rm -f tmpu.texi
56
57 GNULIB_TEXI_FILES = $(filter-out maintain.texi make-stds.texi standards.texi,$(wildcard *.texi)) $(wildcard posix-headers/*.texi) $(wildcard posix-functions/*.texi) $(wildcard glibc-headers/*.texi) $(wildcard glibc-functions/*.texi)
58
59 # Date of last update. Requires GNU date.
60 updated-stamp: $(GNULIB_TEXI_FILES)
61         date -u -r `ls -t $^ | sed 1q` +"@set UPDATED %F %T" > $@
62
63 # Dependencies. Search for @include to find them all.
64 gnulib.info gnulib.html gnulib.dvi gnulib.pdf: $(GNULIB_TEXI_FILES) updated-stamp
65 standards.info standards.html standards.dvi: standards.texi make-stds.texi fdl.texi
66
67 mostlyclean:
68         rm -f *.aux *.cp *.cps *.fn *.ky *.log *.pg *.toc *.tp *.vr *.vrs
69         rm -f updated-stamp
70
71 clean: mostlyclean
72         rm -f *.info *.html *.dvi *.ps *.pdf