summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/pdftex/manual/Makefile
blob: 7b96d07e7fea1d8a95e8048dc168a79210ecad0b (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
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
# $Id: Makefile 923 2024-02-20 18:48:39Z karl $
# GNU makefile for pdfTeX documentation.  Public domain.

texfot = texfot
pdflatex = $(texfot) pdflatex --file-line-error

tinydoc = incl/pdfmin
help_msg = incl/pdftex-help.txt
syntax_summary = incl/pdftex-syntax.tex

# dependencies for building the manual.
deps = pdftex.tex pdftexmanual.cls \
       $(syntax_summary) $(help_msg) $(tinydoc)-crop.pdf

a4run = $(pdflatex) '\PassOptionsToClass{a4paper}{report} \input $<'
ltrun = $(pdflatex) '\PassOptionsToClass{letterpaper}{report} \input $<'

all: pdftex-a.pdf pdftex-l.pdf

pdftex-a.pdf: $(deps)
	rm -f $@
	$(a4run)
	while grep 'Rerun to get' pdftex.log >/dev/null; do $(a4run); done
	mv pdftex.pdf $@

pdftex-l.pdf: $(deps)
	rm -f $@
	$(ltrun)
	while grep 'Rerun to get' pdftex.log >/dev/null; do $(ltrun); done
	mv pdftex.pdf $@

# Run when making new manual for release; by hand, since it's too
# irritating to depend on the binary.
pdftex-help $(help_msg):
	$(pdftex_binary) --help >$(help_msg)
	(echo; echo; echo) >>$(help_msg)
	$(pdftex_binary) --version >>$(help_msg)
	
# Primitives and syntax, in TeX for the printed manual.
$(syntax_summary): pdftex.tex syntaxform.pl
	perl syntaxform.pl pdftex.tex >$(syntax_summary) || rm -f $@

# We want to typeset the PDF for a tiny input file. This should be
# updated every year:
# - update version numbers.
# - make new binary in source tree.
# - run make frontispiece.pdf.
# (Also run make pdftex-help.)
#
pdftex_binary = ../../source/build-pdftex/texk/web2c/pdftex
texdist_fonts = /usr/local/texlive/dev/texmf-dist/fonts
#
$(tinydoc)-src.pdf: $(tinydoc)-src.tex
	env KPATHSEA_WARNING=0 TEXFONTS=$(texdist_fonts)// \
	  $(pdftex_binary) -ini -output-directory=incl '$<'

# The title page PDF as TeXable text.
$(tinydoc)-src.txt: $(tinydoc)-src.pdf #GNUmakefile
	test -s $<
	cat $< \
	| expand \
	| grep -v '^$$' \
	| fmt -s -w45 \
	| expand >$@ || rm -f $@
	wc -l $@  # set titlepagelines=half this plus one:

# Convert that TeXt to PDF.
$(tinydoc)-fmt.pdf: $(tinydoc)-fmt.tex $(tinydoc)-src.txt
	context $< >$(tinydoc)-fmt.fot 2>&1
	test -s `basename $@`
	mv `basename $(tinydoc)`-fmt.* incl/

$(tinydoc)-crop.pdf: $(tinydoc)-fmt.pdf
	pdfcrop $< $@

#  Install from this source directory to TL.

# svn co svn://u:pw@tug.org/texlive/trunk/Master/texmf-dist/doc/pdftex
tltree = /home/texlive/karl/Master/texmf-dist
dest = $(tltree)/doc/pdftex/manual/

INSTALL_DATA = cp -p

install:
	$(INSTALL_DATA) ChangeLog Makefile README $(dest)
	$(INSTALL_DATA) pdftex-a.pdf pdftex.tex pdftexmanual.cls $(dest)
	$(INSTALL_DATA) incl/*.txt incl/*.tex incl/pdfmin-crop.pdf $(dest)/incl
	$(INSTALL_DATA) syntaxform.pl $(dest)


#  clean.
clean:
	rm -f *.aux *.log *.out *.toc
	rm -f incl/*.fot incl/*.log incl/*.tuc
	rm -f incl/pdftex-syntax.tex

maintainer-clean: clean
	rm -f pdftex-a.pdf pdftex-l.pdf
	rm -f incl/pdftex-help.txt incl/*.pdf

clobber allclean realclean distclean: maintainer-clean

spell:
	dw <pdftex.tex | grep -v cmr10; true
	myspell pdftex.tex