Debian Codegraph @

texmf-dist/doc/pdftex/manual/Makefile

raw
1 # $Id: Makefile 976 2026-01-19 22:40:55Z karl $
2 # GNU makefile for pdfTeX documentation. Public domain.
3
4 texfot = texfot
5 pdflatex = $(texfot) pdflatex --file-line-error
6
7 tinydoc = incl/pdfmin
8 help_msg = incl/pdftex-help.txt
9 syntax_summary = incl/pdftex-syntax.tex
10
11 # dependencies for building the manual.
12 deps = pdftex.tex pdftexmanual.cls \
13 $(syntax_summary) $(help_msg) $(tinydoc)-crop.pdf
14
15 a4run = $(pdflatex) '\PassOptionsToClass{a4paper}{report} \input $<'
16 ltrun = $(pdflatex) '\PassOptionsToClass{letterpaper}{report} \input $<'
17
18 rerun_pattern = ^LaTeX Warning:.*Rerun to get
19
20 default: pdftex-a.pdf
21 all: pdftex-a.pdf pdftex-l.pdf
22
23 pdftex-a.pdf: $(deps)
24 rm -f $@
25 $(a4run)
26 while grep '$(rerun_pattern)' pdftex.log; do $(a4run); done
27 mv pdftex.pdf $@
28
29 pdftex-l.pdf: $(deps)
30 rm -f $@
31 $(ltrun)
32 while grep $(rerun_pattern) pdftex.log >/dev/null; do $(ltrun); done
33 mv pdftex.pdf $@
34
35 # Run when making new manual for release; by hand, since it's too
36 # irritating to depend on the binary.
37 pdftex-help $(help_msg):
38 $(pdftex_binary) --help >$(help_msg)
39 (echo; echo; echo) >>$(help_msg)
40 $(pdftex_binary) --version >>$(help_msg)
41
42 # Primitives and syntax, in TeX for the printed manual.
43 $(syntax_summary): pdftex.tex syntaxform.pl
44 perl syntaxform.pl pdftex.tex >$(syntax_summary) || rm -f $@
45
46 # We want to typeset the PDF for a tiny input file. This should be
47 # updated every year:
48 # - update version numbers.
49 # - make new binary in source tree.
50 # - run make frontispiece.
51 # - ensure result still fits on one page.
52 # (Also, unrelated but also yearly, run make pdftex-help.)
53 #
54 pdftex_binary = ../../source/build-pdftex/texk/web2c/pdftex
55 texdist_fonts = /usr/local/texlive/dev/texmf-dist/fonts
56 #
57 $(tinydoc)-src.pdf: $(tinydoc)-src.tex
58 env KPATHSEA_WARNING=0 TEXFONTS=$(texdist_fonts)// \
59 $(pdftex_binary) -ini -output-directory=incl '$<'
60
61 # The title page PDF as TeXable text.
62 $(tinydoc)-src.txt: $(tinydoc)-src.pdf #GNUmakefile
63 test -s $<
64 cat $< \
65 | expand \
66 | grep -v '^$$' \
67 | fmt -s -w45 \
68 | expand >$@ || rm -f $@
69 wc -l $@ # set titlepagelines=half this plus one:
70
71 # Convert that TeXt to PDF.
72 $(tinydoc)-fmt.pdf: $(tinydoc)-fmt.tex $(tinydoc)-src.txt
73 context $< >$(tinydoc)-fmt.fot 2>&1
74 test -s `basename $@`
75 mv `basename $(tinydoc)`-fmt.* incl/
76
77 tinyfinal = $(tinydoc)-crop
78 frontispiece $(tinyfinal).pdf: $(tinydoc)-fmt.pdf
79 pdfcrop $< $(tinyfinal).pdf
80 npages=`pdfinfo $(tinyfinal).pdf | awk '$$1=="Pages:" {print $$2}'`; \
81 test $$npages = 1
82
83 # Install from this source directory to TL.
84
85 # svn co svn://u:[email protected]/texlive/trunk/Master/texmf-dist/doc/pdftex
86 tltree = /home/texlive/karl/Master/texmf-dist
87 dest = $(tltree)/doc/pdftex/manual/
88
89 INSTALL_DATA = cp -p
90
91 install:
92 $(INSTALL_DATA) ChangeLog Makefile README $(dest)
93 $(INSTALL_DATA) pdftex-a.pdf pdftex.tex pdftexmanual.cls $(dest)
94 $(INSTALL_DATA) incl/*.txt incl/*.tex incl/pdfmin-crop.pdf $(dest)/incl
95 $(INSTALL_DATA) syntaxform.pl $(dest)
96
97
98 # clean.
99 clean:
100 rm -f *.aux *.log *.out *.toc
101 rm -f incl/*.fot incl/*.log incl/*.tuc
102 rm -f incl/pdftex-syntax.tex
103
104 maintainer-clean: clean
105 rm -f pdftex-a.pdf pdftex-l.pdf
106 rm -f incl/pdftex-help.txt incl/*.pdf
107
108 clobber allclean realclean distclean: maintainer-clean
109
110 spell:
111 dw <pdftex.tex | grep -v cmr10; true
112 myspell pdftex.tex