Commit b9b4c5b5 authored by Fred Drake's avatar Fred Drake

Centralize the processing logic for LaTeX documents into the mkhowto script;

do not use mkdvi.sh or mkhtl.sh any more.

This slows down building all versions of the documentation, but if you are
only building one format, it does not matter.
parent fcab7635
# Convenience Makefile for building HTML documentation. You probably need to # Convenience Makefile for building HTML documentation. You probably
# set TEXINPUTS from the command line for this to be useful, unless you # need to set TEXINPUTS from the command line for this to be useful,
# actually build the .dvi files in the top level directory. # unless you actually build the .dvi files in the top level directory.
#
# Note that the .dvi files must already be built and TEXINPUTS must include the
# directory where latex's working files (esp. *.aux) are kept.
PAPER=letter PAPER=letter
TOPDIR=.. TOPDIR=..
...@@ -15,16 +12,10 @@ TEXINPUTS=$(TOPDIR)/paper-$(PAPER):$(TOPDIR)/texinputs: ...@@ -15,16 +12,10 @@ TEXINPUTS=$(TOPDIR)/paper-$(PAPER):$(TOPDIR)/texinputs:
# Where are the various programs? # Where are the various programs?
PYTHON= python PYTHON= python
WEBCHECKER=$(PYTHON) $(TOPDIR)/../Tools/webchecker/webchecker.py WEBCHECKER=$(PYTHON) $(TOPDIR)/../Tools/webchecker/webchecker.py
WCNEW=$(PYTHON) $(TOPDIR)/../Tools/webchecker/wcnew.py MKHOWTO= $(TOOLSDIR)/mkhowto
MKAUX= PAPER=$(PAPER) TEXINPUTS=$(TEXINPUTS) $(TOOLSDIR)/mkdvi.sh --aux
MKHTML= PAPER=$(PAPER) $(TOOLSDIR)/mkhtml.sh
KPSEWHICH= TEXINPUTS=$(TEXINPUTS) kpsewhich tex
BUILDINDEX=$(TOOLSDIR)/buildindex.py BUILDINDEX=$(TOOLSDIR)/buildindex.py
# make it clear to l2h, since our support only generates HTML 4.0
L2HARGS= -html_version 4.0
PYTHONDOCS='<hr>See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.' PYTHONDOCS='<hr>See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.'
HTMLBASE= file:`pwd` HTMLBASE= file:`pwd`
...@@ -70,55 +61,43 @@ modindex.html: lib/lib.html mac/mac.html $(TOOLSDIR)/mkmodindex ...@@ -70,55 +61,43 @@ modindex.html: lib/lib.html mac/mac.html $(TOOLSDIR)/mkmodindex
--address $(PYTHONDOCS) \ --address $(PYTHONDOCS) \
lib/modindex.html mac/modindex.html lib/modindex.html mac/modindex.html
api/api.html: $(PAPERDIR)/api.aux $(BUILDINDEX) $(TOOLSDIR)/mkhtml.sh api/api.html: $(APIFILES) $(BUILDINDEX)
$(MKHTML) api $(L2HARGS) -split 5 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
--html $(TOPDIR)/api/api.tex
doc/doc.html: $(DOCFILES) $(BUILDINDEX) $(TOPDIR)/perl/ltxmarkup.perl doc/doc.html: $(DOCFILES) $(BUILDINDEX)
$(TOOLSDIR)/mkhowto --about stdabout.dat --address $(PYTHONDOCS) \ $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
--html $(TOPDIR)/doc/doc.tex --html $(TOPDIR)/doc/doc.tex
ext/ext.html: $(PAPERDIR)/ext.aux $(TOOLSDIR)/mkhtml.sh ext/ext.html: $(EXTFILES)
$(MKHTML) ext $(L2HARGS) -split 5 echo $(EXTFILES)
$(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
--html $(TOPDIR)/ext/ext.tex
lib/lib.html: $(PAPERDIR)/lib.aux $(BUILDINDEX) $(TOOLSDIR)/mkhtml.sh lib/lib.html: $(LIBFILES) $(BUILDINDEX)
$(TOOLSDIR)/fix_libaux.sed <`$(KPSEWHICH) lib.aux` >lib1.aux $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
mv lib1.aux `$(KPSEWHICH) lib.aux` --html $(TOPDIR)/lib/lib.tex
$(MKHTML) lib $(L2HARGS) -split 5
mac/mac.html: $(MACFILES) $(BUILDINDEX) mac/mac.html: $(MACFILES) $(BUILDINDEX)
$(TOOLSDIR)/mkhowto --about stdabout.dat --address $(PYTHONDOCS) \ $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
--html $(TOPDIR)/mac/mac.tex --html $(TOPDIR)/mac/mac.tex
ref/ref.html: $(PAPERDIR)/ref.aux $(BUILDINDEX) $(TOOLSDIR)/mkhtml.sh ref/ref.html: $(REFFILES) $(BUILDINDEX)
$(MKHTML) ref $(L2HARGS) -split 5 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
--html $(TOPDIR)/ref/ref.tex
tut/tut.html: $(PAPERDIR)/tut.aux $(TOOLSDIR)/mkhtml.sh tut/tut.html: $(TUTFILES) $(TOOLSDIR)/mkhowto
$(MKHTML) --numeric tut $(L2HARGS) -split 3 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
--html --numeric --split 3 $(TOPDIR)/tut/tut.tex
inst/inst.html:$(INSTFILES) $(TOPDIR)/perl/distutils.perl inst/inst.html: $(INSTFILES) $(TOPDIR)/perl/distutils.perl
$(TOOLSDIR)/mkhowto --about stdabout.dat --address $(PYTHONDOCS) \ $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
--html $(TOPDIR)/inst/inst.tex --html $(TOPDIR)/inst/inst.tex
dist/dist.html:$(DISTFILES) $(TOPDIR)/perl/distutils.perl dist/dist.html:$(DISTFILES) $(TOPDIR)/perl/distutils.perl
$(TOOLSDIR)/mkhowto --about stdabout.dat --address $(PYTHONDOCS) \ $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
--html $(TOPDIR)/dist/dist.tex --html $(TOPDIR)/dist/dist.tex
$(PAPERDIR)/api.aux: $(APIFILES)
(cd $(PAPERDIR); $(MKAUX) api)
$(PAPERDIR)/ext.aux: $(EXTFILES)
(cd $(PAPERDIR); $(MKAUX) ext)
$(PAPERDIR)/lib.aux: $(LIBFILES)
(cd $(PAPERDIR); $(MKAUX) lib)
$(PAPERDIR)/ref.aux: $(REFFILES)
(cd $(PAPERDIR); $(MKAUX) ref)
$(PAPERDIR)/tut.aux: $(TUTFILES)
(cd $(PAPERDIR); $(MKAUX) tut)
webcheck: all webcheck: all
$(WEBCHECKER) $(HTMLBASE)/api/ $(WEBCHECKER) $(HTMLBASE)/api/
$(WEBCHECKER) $(HTMLBASE)/doc/ $(WEBCHECKER) $(HTMLBASE)/doc/
...@@ -130,16 +109,6 @@ webcheck: all ...@@ -130,16 +109,6 @@ webcheck: all
$(WEBCHECKER) $(HTMLBASE)/dist/ $(WEBCHECKER) $(HTMLBASE)/dist/
$(WEBCHECKER) $(HTMLBASE)/inst/ $(WEBCHECKER) $(HTMLBASE)/inst/
wcnew: all
$(WCNEW) $(HTMLBASE)/api/
$(WCNEW) $(HTMLBASE)/doc/
$(WCNEW) $(HTMLBASE)/ext/
$(WCNEW) -m290000 $(HTMLBASE)/lib/
$(WCNEW) $(HTMLBASE)/mac/
$(WCNEW) $(HTMLBASE)/ref/
$(WCNEW) $(HTMLBASE)/tut/
clean: clean:
rm -rf @webchecker.pickle rm -rf @webchecker.pickle
...@@ -154,7 +123,7 @@ distclean realclean clobber: clean ...@@ -154,7 +123,7 @@ distclean realclean clobber: clean
# It's at the end of the file since it wedges font-lock in XEmacs. # It's at the end of the file since it wedges font-lock in XEmacs.
BOILERPLATE=$(TOPDIR)/texinputs/boilerplate.tex BOILERPLATE=$(TOPDIR)/texinputs/boilerplate.tex
index.html: index.html.in $(BOILERPLATE) index.html: $(TOPDIR)/html/index.html.in $(BOILERPLATE)
REL=`grep '\\release{' $(BOILERPLATE) | sed 's/.*\\release{\(.*\)}.*$$/\1/'`; \ REL=`grep '\\release{' $(BOILERPLATE) | sed 's/.*\\release{\(.*\)}.*$$/\1/'`; \
REL=`echo "$$REL" | sed 's/[$$]//g'`; \ REL=`echo "$$REL" | sed 's/[$$]//g'`; \
sed "s/@RELEASE@/$$REL/g" $< >TEMP sed "s/@RELEASE@/$$REL/g" $< >TEMP
...@@ -162,4 +131,3 @@ index.html: index.html.in $(BOILERPLATE) ...@@ -162,4 +131,3 @@ index.html: index.html.in $(BOILERPLATE)
if [ "$$DATE" = '\today' ] ; then DATE=`date '+%B %e, %Y'`;fi;\ if [ "$$DATE" = '\today' ] ; then DATE=`date '+%B %e, %Y'`;fi;\
sed "s/@DATE@/$$DATE/g" TEMP >$@ sed "s/@DATE@/$$DATE/g" TEMP >$@
rm -f TEMP rm -f TEMP
...@@ -2,20 +2,14 @@ ...@@ -2,20 +2,14 @@
PAPER=letter PAPER=letter
# Where are the various programs? # Where are the various programs?
LATEX= latex
PDFLATEX= pdflatex
DVIPS= dvips -N0 -t $(PAPER) DVIPS= dvips -N0 -t $(PAPER)
MAKEINDEX= makeindex -s ../texinputs/python.ist
PYTHON= python PYTHON= python
TOOLSDIR= ../tools TOOLSDIR= ../tools
TEXINPUTS= .:../texinputs:
MKDVI= TEXINPUTS=$(TEXINPUTS) $(TOOLSDIR)/mkdvi.sh MKHOWTO= $(TOOLSDIR)/mkhowto
# The --keep option is needed to keep the intermediate files for generating MKDVI= $(MKHOWTO) --dvi
# the HTML global module index. MKPDF= $(MKHOWTO) --pdf
MKHOWTO= $(TOOLSDIR)/mkhowto --keep
MKPDF= TEXINPUTS=$(TEXINPUTS) $(TOOLSDIR)/mkdvi.sh --pdf
# what's what # what's what
...@@ -36,17 +30,14 @@ PSFILES= $(MANPSFILES) $(HOWTOPSFILES) ...@@ -36,17 +30,14 @@ PSFILES= $(MANPSFILES) $(HOWTOPSFILES)
include ../Makefile.deps include ../Makefile.deps
SCRIPTS: ../tools/fix_hack ../tools/mkdvi.sh ../tools/indfix.py SCRIPTS: ../tools/indfix.py
$(DVIFILES): $(SCRIPTS) $(DVIFILES): $(SCRIPTS) $(MKHOWTO)
$(PDFFILES): $(SCRIPTS) $(PDFFILES): $(SCRIPTS) $(MKHOWTO)
$(HOWTODVIFILES): ../tools/mkhowto
$(HOWTOPDFFILES): ../tools/mkhowto
# Rules to build PostScript and PDF formats # Rules to build PostScript and PDF formats
.SUFFIXES: .dvi .ps .pdf .SUFFIXES: .dvi .ps
.dvi.ps: .dvi.ps:
$(DVIPS) -o $@ $< $(DVIPS) -o $@ $<
...@@ -64,20 +55,20 @@ README: $(PSFILES) $(TOOLSDIR)/getpagecounts ...@@ -64,20 +55,20 @@ README: $(PSFILES) $(TOOLSDIR)/getpagecounts
# Python/C API Reference Manual # Python/C API Reference Manual
api.dvi: api.tex $(APIFILES) api.dvi: api.tex $(APIFILES)
$(MKDVI) api $(MKDVI) ../api/api.tex
api.pdf: api.tex $(APIFILES) api.pdf: api.tex $(APIFILES)
$(MKPDF) api $(MKPDF) ../api/api.tex
api.tex: ../api/api.tex ../api/refcounts.dat ../tools/anno-api.py api.tex: ../api/api.tex ../api/refcounts.dat ../tools/anno-api.py
$(PYTHON) ../tools/anno-api.py -o $@ ../api/api.tex $(PYTHON) ../tools/anno-api.py -o $@ ../api/api.tex
# Distributing Python Modules # Distributing Python Modules
dist.dvi: $(DISTFILES) dist.dvi: $(DISTFILES)
$(MKHOWTO) --dvi ../dist/dist.tex $(MKDVI) ../dist/dist.tex
dist.pdf: $(DISTFILES) dist.pdf: $(DISTFILES)
$(MKHOWTO) --pdf ../dist/dist.tex $(MKPDF) ../dist/dist.tex
# Documenting Python # Documenting Python
doc.dvi: $(DOCFILES) doc.dvi: $(DOCFILES)
...@@ -88,10 +79,10 @@ doc.pdf: $(DOCFILES) ...@@ -88,10 +79,10 @@ doc.pdf: $(DOCFILES)
# Extending and Embedding the Python Interpreter # Extending and Embedding the Python Interpreter
ext.dvi: $(EXTFILES) ext.dvi: $(EXTFILES)
$(MKDVI) ext $(MKDVI) ../ext/ext.tex
ext.pdf: $(EXTFILES) ext.pdf: $(EXTFILES)
$(MKPDF) ext $(MKPDF) ../ext/ext.tex
# Installing Python Modules # Installing Python Modules
inst.dvi: $(INSTFILES) inst.dvi: $(INSTFILES)
...@@ -102,10 +93,10 @@ inst.pdf: $(INSTFILES) ...@@ -102,10 +93,10 @@ inst.pdf: $(INSTFILES)
# Python Library Reference # Python Library Reference
lib.dvi: $(LIBFILES) lib.dvi: $(LIBFILES)
$(MKDVI) lib $(MKDVI) ../lib/lib.tex
lib.pdf: $(LIBFILES) lib.pdf: $(LIBFILES)
$(MKPDF) lib $(MKPDF) ../lib/lib.tex
# Macintosh Library Modules # Macintosh Library Modules
mac.dvi: $(MACFILES) mac.dvi: $(MACFILES)
...@@ -116,17 +107,17 @@ mac.pdf: $(MACFILES) ...@@ -116,17 +107,17 @@ mac.pdf: $(MACFILES)
# Python Reference Manual # Python Reference Manual
ref.dvi: $(REFFILES) ref.dvi: $(REFFILES)
$(MKDVI) ref $(MKDVI) ../ref/ref.tex
ref.pdf: $(REFFILES) ref.pdf: $(REFFILES)
$(MKPDF) ref $(MKPDF) ../ref/ref.tex
# Python Tutorial # Python Tutorial
tut.dvi: $(TUTFILES) tut.dvi: $(TUTFILES)
$(MKDVI) tut $(MKDVI) ../tut/tut.tex
tut.pdf: $(TUTFILES) tut.pdf: $(TUTFILES)
$(MKPDF) tut $(MKPDF) ../tut/tut.tex
clean: clean:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment