summaryrefslogtreecommitdiff
path: root/Build/source/doc/Makefile.am
blob: 23aa01a021886e174e7b4e1118344596f74c36c6 (plain)
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
## Makefile.am for the TeX Live subdirectory ./doc/
##
## Copyright 2013-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
##
## The info files
info_TEXINFOS = tlbuild.texi
tlbuild_TEXINFOS = build-tools.txt \
  tlbuild-incl/install-tl.texi tlbuild-incl/tlmgr.texi

EXTRA_DIST = \
	README.solaris \
	splitinfo.gawk

# no reasonable way to avoid it with the pod doc.
MAKEINFOFLAGS = --set INFO_SPECIAL_CHARS_WARNING=0

#  autogenerate the top-level README files.
readme-files: tlbuild.info
	rm -f README.*
	$(MAKEINFO) $(MAKEINFOFLAGS) --plaintext -o - $(srcdir)/tlbuild.texi \
	| tee /tmp/a \
	| gawk -f $(srcdir)/splitinfo.gawk
	ls -l README.*
#	head -8 README.*
readme-install: readme-files
	cp -p README.* $(top_srcdir)/
	svn diff $(top_srcdir)/README.* >/tmp/sd
	svn status $(top_srcdir)/README.*
#
.PHONY: readme-files readme-install

#  autogenerate texinfo from install-tl and tlmgr pod.
# none of this is intended to be executed except manually.
mydoc = tlbuild

# until the next texinfo release, need development texinfo
# for --appendix-sections.
texinfo_dir = $(HOME)/gnu/src/texinfo
pod2texi = perl $(texinfo_dir)/Pod-Simple-Texinfo/pod2texi.pl
pod2texi_args = \
  --appendix-sections \
  --base-level=section \
  --no-fill-section-gaps \
  --preamble=''

# We use a complicated L<> section reference in the tlmgr pod,
# schematically like this:
#   L<whatever|/mysec I<myital>>
# Unfortunately, the Pod module does not pass the necessary information
# in the callbacks to allow pod2texi to preserve the I<>.  It seems
# better to kludge in some substitutions here than reimplement a whole
# pod parser.  Sigh.
#
update_node_bad  = ref{tlmgr update [option]... [pkg]...
update_node_good = ref{tlmgr update [\@emph{option}]... [\@emph{pkg}]...
install_node_bad = ref{tlmgr install [option]... pkg...
install_node_good = ref{tlmgr install [\@emph{option}]... \@emph{pkg}...

# we don't actually use the (autogenerated) -incl.texi file,
# but it makes for a convenient target.
$(mydoc)-incl.texi: install-tl tlmgr.pl 
	$(pod2texi) -o $@ --subdir=$(mydoc)-incl $(pod2texi_args) $^
	perl -pi \
          -e 's/\Q$(update_node_bad)\E/$(update_node_good)/' \
          -e ';' \
          -e 's/\Q$(install_node_bad)\E/$(install_node_good)/' \
	  $(mydoc)-incl/tlmgr.texi
.PHONY: $(mydoc)-incl.texi