Convert to a "flat" Makefile.
diff --git a/Doc/Makefile b/Doc/Makefile
index 0bc2b2e..cd2129a 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -69,112 +69,148 @@
 # names of the downloadable tarballs.
 RELEASE=2.1a2
 
+PYTHON=	   python
+DVIPS=	   dvips -N0 -t $(PAPER)
+
+MKHOWTO=   $(TOOLSDIR)/mkhowto
+MKHTML=	   $(MKHOWTO) --html --about html/stdabout.dat \
+		--address $(PYTHONDOCS) --up-link ../index.html \
+		--up-title "Python Documentation Index" \
+		--global-module-index "../modindex.html"
+MKPDF=	   $(MKHOWTO) --paper=$(PAPER) --pdf
+MKPS=	   $(MKHOWTO) --paper=$(PAPER) --ps
+
+BUILDINDEX=$(TOOLSDIR)/buildindex.py
+
+PYTHONDOCS='See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.'
+HTMLBASE=  file:`pwd`
+
+# what's what
+MANDVIFILES=	paper-$(PAPER)/api.dvi paper-$(PAPER)/ext.dvi \
+		paper-$(PAPER)/lib.dvi paper-$(PAPER)/mac.dvi \
+		paper-$(PAPER)/ref.dvi paper-$(PAPER)/tut.dvi
+HOWTODVIFILES=	paper-$(PAPER)/doc.dvi paper-$(PAPER)/inst.dvi \
+		paper-$(PAPER)/dist.dvi
+
+MANPDFFILES=	paper-$(PAPER)/api.pdf paper-$(PAPER)/ext.pdf \
+		paper-$(PAPER)/lib.pdf paper-$(PAPER)/mac.pdf \
+		paper-$(PAPER)/ref.pdf paper-$(PAPER)/tut.pdf
+HOWTOPDFFILES=	paper-$(PAPER)/doc.pdf paper-$(PAPER)/inst.pdf \
+		paper-$(PAPER)/dist.pdf
+
+MANPSFILES=	paper-$(PAPER)/api.ps paper-$(PAPER)/ext.ps \
+		paper-$(PAPER)/lib.ps paper-$(PAPER)/mac.ps \
+		paper-$(PAPER)/ref.ps paper-$(PAPER)/tut.ps
+HOWTOPSFILES=	paper-$(PAPER)/doc.ps paper-$(PAPER)/inst.ps \
+		paper-$(PAPER)/dist.ps
+
+DVIFILES=	$(MANDVIFILES) $(HOWTODVIFILES)
+PDFFILES=	$(MANPDFFILES) $(HOWTOPDFFILES)
+PSFILES=	$(MANPSFILES) $(HOWTOPSFILES)
+
+INDEXFILES=html/api/api.html \
+	html/doc/doc.html \
+	html/ext/ext.html \
+	html/lib/lib.html \
+	html/mac/mac.html \
+	html/ref/ref.html \
+	html/tut/tut.html \
+	html/inst/inst.html \
+	html/dist/dist.html
+
+COMMONPERL= perl/manual.perl perl/python.perl perl/l2hinit.perl
+
+include Makefile.deps
 
 # These must be declared phony since there
 # are directories with matching names:
 .PHONY: api doc ext lib mac ref tut inst dist
-.PHONY: html info longhtml
+.PHONY: html info
 
 
 # Main target
 all:	html
 
-dvi:
-	(cd paper-$(PAPER); $(MAKE) dvi)
+dvi:	$(DVIFILES)
+pdf:	$(PDFFILES)
+ps:	$(PSFILES)
 
-pdf:
-	(cd paper-$(PAPER); $(MAKE) pdf)
+world:	ps pdf html distfiles
 
-ps:
-	(cd paper-$(PAPER); $(MAKE) ps)
 
-world:	ps pdf html tarballs
+# Rules to build PostScript and PDF formats
+.SUFFIXES: .dvi .ps
+
+.dvi.ps:
+	$(DVIPS) -o $@ $<
 
 
 # Targets for each document:
-api.ps:
-	(cd paper-$(PAPER); $(MAKE) api.ps)
+# Python/C API Reference Manual
+paper-$(PAPER)/api.dvi: paper-$(PAPER)/api.tex $(APIFILES)
+	(cd paper-$(PAPER); $(MKDVI) api.tex)
 
-doc.ps:
-	(cd paper-$(PAPER); $(MAKE) doc.ps)
+paper-$(PAPER)/api.pdf: paper-$(PAPER)/api.tex $(APIFILES)
+	(cd paper-$(PAPER); $(MKPDF) api.tex)
 
-ext.ps:
-	(cd paper-$(PAPER); $(MAKE) ext.ps)
+paper-$(PAPER)/api.tex: api/api.tex api/refcounts.dat tools/anno-api.py
+	$(PYTHON) $(TOOLSDIR)/anno-api.py -o $@ api/api.tex
 
-lib.ps:
-	(cd paper-$(PAPER); $(MAKE) lib.ps)
+# Distributing Python Modules
+paper-$(PAPER)/dist.dvi: $(DISTFILES)
+	(cd paper-$(PAPER); $(MKDVI) ../dist/dist.tex)
 
-mac.ps:
-	(cd paper-$(PAPER); $(MAKE) mac.ps)
+paper-$(PAPER)/dist.pdf: $(DISTFILES)
+	(cd paper-$(PAPER); $(MKPDF) ../dist/dist.tex
 
-ref.ps:
-	(cd paper-$(PAPER); $(MAKE) ref.ps)
+# Documenting Python
+paper-$(PAPER)/doc.dvi: $(DOCFILES)
+	(cd paper-$(PAPER); $(MKDVI) ../doc/doc.tex
 
-tut.ps:
-	(cd paper-$(PAPER); $(MAKE) tut.ps)
+paper-$(PAPER)/doc.pdf: $(DOCFILES)
+	(cd paper-$(PAPER); $(MKPDF) ../doc/doc.tex_
 
-inst.ps:
-	(cd paper-$(PAPER); $(MAKE) inst.ps)
+# Extending and Embedding the Python Interpreter
+paper-$(PAPER)/ext.dvi: $(EXTFILES)
+	(cd paper-$(PAPER); $(MKDVI) ../ext/ext.tex)
 
-dist.ps:
-	(cd paper-$(PAPER); $(MAKE) dist.ps)
+paper-$(PAPER)/ext.pdf: $(EXTFILES)
+	(cd paper-$(PAPER); $(MKPDF) ../ext/ext.tex)
 
+# Installing Python Modules
+paper-$(PAPER)/inst.dvi: $(INSTFILES)
+	(cd paper-$(PAPER); $(MKDVI) ../inst/inst.tex)
 
-api.dvi:
-	(cd paper-$(PAPER); $(MAKE) api.dvi)
+paper-$(PAPER)/inst.pdf: $(INSTFILES)
+	(cd paper-$(PAPER); $(MKPDF) ../inst/inst.tex)
 
-doc.dvi:
-	(cd paper-$(PAPER); $(MAKE) doc.dvi)
+# Python Library Reference
+paper-$(PAPER)/lib.dvi: $(LIBFILES)
+	(cd paper-$(PAPER); $(MKDVI) ../lib/lib.tex)
 
-ext.dvi:
-	(cd paper-$(PAPER); $(MAKE) ext.dvi)
+paper-$(PAPER)/lib.pdf: $(LIBFILES)
+	(cd paper-$(PAPER); $(MKPDF) ../lib/lib.tex)
 
-lib.dvi:
-	(cd paper-$(PAPER); $(MAKE) lib.dvi)
+# Macintosh Library Modules
+paper-$(PAPER)/mac.dvi: $(MACFILES)
+	(cd paper-$(PAPER); $(MKDVI) ../mac/mac.tex)
 
-mac.dvi:
-	(cd paper-$(PAPER); $(MAKE) mac.dvi)
+paper-$(PAPER)/mac.pdf: $(MACFILES)
+	(cd paper-$(PAPER); $(MKPDF) ../mac/mac.tex)
 
-ref.dvi:
-	(cd paper-$(PAPER); $(MAKE) ref.dvi)
+# Python Reference Manual
+paper-$(PAPER)/ref.dvi: $(REFFILES)
+	(cd paper-$(PAPER); $(MKDVI) ../ref/ref.tex)
 
-tut.dvi:
-	(cd paper-$(PAPER); $(MAKE) tut.dvi)
+paper-$(PAPER)/ref.pdf: $(REFFILES)
+	(cd paper-$(PAPER); $(MKPDF) ../ref/ref.tex)
 
-inst.dvi:
-	(cd paper-$(PAPER); $(MAKE) inst.dvi)
+# Python Tutorial
+paper-$(PAPER)/tut.dvi: $(TUTFILES)
+	(cd paper-$(PAPER); $(MKDVI) ../tut/tut.tex)
 
-dist.dvi:
-	(cd paper-$(PAPER); $(MAKE) dist.dvi)
-
-
-api.pdf:
-	(cd paper-$(PAPER); $(MAKE) api.pdf)
-
-doc.pdf:
-	(cd paper-$(PAPER); $(MAKE) doc.pdf)
-
-ext.pdf:
-	(cd paper-$(PAPER); $(MAKE) ext.pdf)
-
-lib.pdf:
-	(cd paper-$(PAPER); $(MAKE) lib.pdf)
-
-mac.pdf:
-	(cd paper-$(PAPER); $(MAKE) mac.pdf)
-
-ref.pdf:
-	(cd paper-$(PAPER); $(MAKE) ref.pdf)
-
-tut.pdf:
-	(cd paper-$(PAPER); $(MAKE) tut.pdf)
-
-inst.pdf:
-	(cd paper-$(PAPER); $(MAKE) inst.pdf)
-
-dist.pdf:
-	(cd paper-$(PAPER); $(MAKE) dist.pdf)
-
+paper-$(PAPER)/tut.pdf: $(TUTFILES)
+	(cd paper-$(PAPER); $(MKPDF) ../tut/tut.tex)
 
 # The remaining part of the Makefile is concerned with various
 # conversions, as described above.  See also the README file.
@@ -198,47 +234,80 @@
 # instead.  The standard set does *not* include all the icons used in the
 # Python documentation.
 
-html:
-	(cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile)
+$(INDEXFILES): $(COMMONPERL) html/about.dat tools/node2label.pl
 
-api htmlapi:
-	(cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile api)
+html/acks.html: ACKS $(TOOLSDIR)/support.py $(TOOLSDIR)/mkackshtml
+	$(TOOLSDIR)/mkackshtml --address $(PYTHONDOCS) \
+		--output html/acks.html <../ACKS
 
-doc htmldoc:
-	(cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile doc)
+html/modindex.html: $(TOOLSDIR)/support.py $(TOOLSDIR)/mkmodindex
+html/modindex.html: html/lib/lib.html html/mac/mac.html
+	$(TOOLSDIR)/mkmodindex --columns 4 --output html/modindex.html \
+		--address $(PYTHONDOCS) \
+		html/lib/modindex.html html/mac/modindex.html
 
-ext htmlext:
-	(cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile ext)
+html:	$(INDEXFILES) html/index.html html/modindex.html html/acks.html
 
-lib htmllib:
-	(cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile lib)
+api html/api/api.html: $(APIFILES)
+	$(MKHTML) --dir html/api api/api.tex
 
-mac htmlmac:
-	(cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile mac)
+doc html/doc/doc.html: $(DOCFILES)
+	$(MKHTML) --dir html/doc doc/doc.tex
 
-ref htmlref:
-	(cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile ref)
+ext html/ext/ext.html: $(EXTFILES)
+	$(MKHTML) --dir html/ext ext/ext.tex
 
-tut htmltut:
-	(cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile tut)
+lib html/lib/lib.html: $(LIBFILES)
+	$(MKHTML) --dir html/lib lib/lib.tex
 
-inst htmlinst:
-	(cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile inst)
+mac html/mac/mac.html: $(MACFILES)
+	$(MKHTML) --dir html/mac mac/mac.tex
 
-dist htmldist:
-	(cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile dist)
+ref html/ref/ref.html: $(REFFILES)
+	$(MKHTML) --dir html/ref ref/ref.tex
 
-longhtml:
-	(cd longhtml; $(MAKE) PAPER=$(PAPER))
+tut html/tut/tut.html: $(TUTFILES)
+	$(MKHTML) --dir html/tut --numeric --split 3 tut/tut.tex
+
+inst html/inst/inst.html: $(INSTFILES) perl/distutils.perl
+	$(MKHTML) --dir html/inst inst/inst.tex
+
+dist html/dist/dist.html: $(DISTFILES) perl/distutils.perl
+	$(MKHTML) --dir html/dist dist/dist.tex
 
 
 # webchecker needs an extra flag to process the huge index from the libref
-webcheck:
-	(cd $(HTMLDIR); $(MAKE) -f ../html/Makefile webcheck)
+WEBCHECKER=$(PYTHON) ../Tools/webchecker/webchecker.py
+HTMLBASE=  file:`pwd`/html
+
+webcheck: html
+	$(WEBCHECKER) $(HTMLBASE)/api/
+	$(WEBCHECKER) $(HTMLBASE)/doc/
+	$(WEBCHECKER) $(HTMLBASE)/ext/
+	$(WEBCHECKER) -m290000 $(HTMLBASE)/lib/
+	$(WEBCHECKER) $(HTMLBASE)/mac/
+	$(WEBCHECKER) $(HTMLBASE)/ref/
+	$(WEBCHECKER) $(HTMLBASE)/tut/
+	$(WEBCHECKER) $(HTMLBASE)/dist/
+	$(WEBCHECKER) $(HTMLBASE)/inst/
+
+fastwebcheck: html
+	$(WEBCHECKER) -x $(HTMLBASE)/api/
+	$(WEBCHECKER) -x $(HTMLBASE)/doc/
+	$(WEBCHECKER) -x $(HTMLBASE)/ext/
+	$(WEBCHECKER) -x -m290000 $(HTMLBASE)/lib/
+	$(WEBCHECKER) -x $(HTMLBASE)/mac/
+	$(WEBCHECKER) -x $(HTMLBASE)/ref/
+	$(WEBCHECKER) -x $(HTMLBASE)/tut/
+	$(WEBCHECKER) -x $(HTMLBASE)/dist/
+	$(WEBCHECKER) -x $(HTMLBASE)/inst/
 
 
 # Release packaging targets:
 
+paper-$(PAPER)/README: ps $(TOOLSDIR)/getpagecounts
+	(cd paper-$(PAPER); ../$(TOOLSDIR)/getpagecounts >$@)
+
 info-$(RELEASE).tgz: info
 	(cd $(INFODIR); tar cf - README python.dir python-???.info*) \
 		| gzip -9 >$@
@@ -267,16 +336,13 @@
 	rm -f $@
 	(cd paper-$(PAPER); zip -q -9 ../$@ *.pdf)
 
-postscript-$(PAPER)-$(RELEASE).tar.bz2: ps
-	(cd paper-$(PAPER); $(MAKE) README)
+postscript-$(PAPER)-$(RELEASE).tar.bz2: ps paper-$(PAPER)/README
 	(cd paper-$(PAPER); tar cf - *.ps README) | bzip2 -9 >$@
 
-postscript-$(PAPER)-$(RELEASE).tgz: ps
-	(cd paper-$(PAPER); $(MAKE) README)
+postscript-$(PAPER)-$(RELEASE).tgz: ps paper-$(PAPER)/README
 	(cd paper-$(PAPER); tar cf - *.ps README) | gzip -9 >$@
 
-postscript-$(PAPER)-$(RELEASE).zip: ps
-	(cd paper-$(PAPER); $(MAKE) README)
+postscript-$(PAPER)-$(RELEASE).zip: ps paper-$(PAPER)/README
 	rm -f $@
 	(cd paper-$(PAPER); zip -q -9 ../$@ *.ps README)
 
@@ -295,11 +361,6 @@
 	(cd $(HTMLDIR); \
 		zip -q -9 ../$@ *.html */*.css */*.html */*.gif)
 
-longhtml-$(RELEASE).zip:	longhtml
-	rm -f $@
-	(cd longhtml; \
-		zip -q -9 ../$@ */*.css */*.html */*.gif)
-
 # convenience targets:
 
 tarhtml:	html-$(RELEASE).tgz
@@ -311,15 +372,10 @@
 tarballs:	tarpdf tarps tarhtml
 
 ziphtml:	html-$(RELEASE).zip
-ziplonghtml:	longhtml-$(RELEASE).zip
 zipps:		postscript-$(PAPER)-$(RELEASE).zip
 zippdf:		pdf-$(PAPER)-$(RELEASE).zip
 ziplatex:	latex-$(RELEASE).zip
 
-# Only build the longhtml version for final releases; use the second
-# version of this for pre-release versions.
-#
-#zips:		zippdf zipps ziphtml ziplonghtml
 zips:		zippdf zipps ziphtml
 
 bziphtml:	html-$(RELEASE).tar.bz2
@@ -341,24 +397,32 @@
 # - useful results: .dvi, .pdf, .ps, .texi, .info
 clean:
 	(cd paper-$(PAPER); $(MAKE) clean)
-	(cd longhtml; $(MAKE) clean)
-	(cd $(HTMLDIR); $(MAKE) clean)
 	(cd $(INFODIR); $(MAKE) clean)
 
-l2hclean:
-	(cd $(HTMLDIR); $(MAKE) clean)
-
 # Remove temporaries as well as final products
 clobber:
-	(cd $(HTMLDIR); $(MAKE) clobber)
 	rm -f html-$(RELEASE).tgz info-$(RELEASE).tgz
 	rm -f pdf-$(RELEASE).tgz postscript-$(RELEASE).tgz
 	rm -f latex-$(RELEASE).tgz html-$(RELEASE).zip
 	rm -f pdf-$(RELEASE).zip postscript-$(RELEASE).zip
-	(cd paper-$(PAPER); $(MAKE) clobber)
-	(cd longhtml; $(MAKE) clobber)
-	(cd $(HTMLDIR); $(MAKE) clobber)
+	rm -f $(DVIFILES) $(PSFILES) $(PDFFILES)
 	(cd $(INFODIR); $(MAKE) clobber)
+	rm -rf html/index.html html/modindex.html html/acks.html
+	rm -rf html/api/ html/doc/ html/ext/ html/lib/ html/mac/
+	rm -rf html/ref/ html/tut/ html/inst/ html/dist/
 
-realclean:  clobber
-distclean:  clobber
+realclean distclean:  clobber
+
+
+# html/index.html is dependent on $(INDEXFILES) since we want the date
+# on the front index to be updated whenever any of the child documents
+# are updated and boilerplate.tex uses \today as the date.
+
+# It's at the end of the file since it wedges font-lock in XEmacs.
+
+BOILERPLATE=texinputs/boilerplate.tex
+html/index.html: html/index.html.in $(BOILERPLATE) $(INDEXFILES)
+	DATE=`grep '\\date{' $(BOILERPLATE) | sed 's/.*\\date{\(.*\)}.*$$/\1/'` ; \
+	if [ "$$DATE" = '\today' ] ; then DATE=`date '+%B %e, %Y'`;fi;\
+	sed -e "s/@DATE@/$$DATE/g" -e "s/@RELEASE@/$(RELEASE)/g" \
+		$< >$@
diff --git a/Doc/Makefile.deps b/Doc/Makefile.deps
index 7a79996..4ab684f 100644
--- a/Doc/Makefile.deps
+++ b/Doc/Makefile.deps
@@ -1,282 +1,282 @@
 # LaTeX source dependencies; note that the files are named relative to a
 # child directory and not the directory this file is located in.
 
-COMMONSTYLES= ../texinputs/python.sty \
-	../texinputs/pypaper.sty \
-	../texinputs/python.ist
+COMMONSTYLES= texinputs/python.sty \
+	texinputs/pypaper.sty \
+	texinputs/python.ist
 
-COMMONTEX= ../texinputs/copyright.tex \
-	../texinputs/boilerplate.tex
+COMMONTEX= texinputs/copyright.tex \
+	texinputs/boilerplate.tex
 
-MANSTYLES= ../texinputs/fncychap.sty \
-	../texinputs/manual.cls \
+MANSTYLES= texinputs/fncychap.sty \
+	texinputs/manual.cls \
 	$(COMMONSTYLES)
 
-HOWTOSTYLES= ../texinputs/howto.cls \
+HOWTOSTYLES= texinputs/howto.cls \
 	$(COMMONSTYLES)
 
 
-APIFILES= ../api/api.tex $(MANSTYLES) $(COMMONTEX) \
-	../texinputs/reportingbugs.tex
+APIFILES= api/api.tex $(MANSTYLES) $(COMMONTEX) \
+	texinputs/reportingbugs.tex
 
 DOCFILES= $(HOWTOSTYLES) $(COMMONTEX) \
-	../texinputs/ltxmarkup.sty \
-	../doc/doc.tex
+	texinputs/ltxmarkup.sty \
+	doc/doc.tex
 
-EXTFILES= ../ext/ext.tex $(MANSTYLES) $(COMMONTEX) \
-	../texinputs/reportingbugs.tex
+EXTFILES= ext/ext.tex $(MANSTYLES) $(COMMONTEX) \
+	texinputs/reportingbugs.tex
 
-TUTFILES= ../tut/tut.tex $(MANSTYLES) $(COMMONTEX)
+TUTFILES= tut/tut.tex $(MANSTYLES) $(COMMONTEX)
 
 # LaTeX source files for the Python Reference Manual
 REFFILES= $(MANSTYLES) $(COMMONTEX) \
-	../ref/ref.tex \
-	../ref/ref1.tex \
-	../ref/ref2.tex \
-	../ref/ref3.tex \
-	../ref/ref4.tex \
-	../ref/ref5.tex \
-	../ref/ref6.tex \
-	../ref/ref7.tex \
-	../ref/ref8.tex
+	ref/ref.tex \
+	ref/ref1.tex \
+	ref/ref2.tex \
+	ref/ref3.tex \
+	ref/ref4.tex \
+	ref/ref5.tex \
+	ref/ref6.tex \
+	ref/ref7.tex \
+	ref/ref8.tex
 
 # LaTeX source files for the Python Library Reference
 LIBFILES= $(MANSTYLES) $(COMMONTEX) \
-	../lib/lib.tex \
-	../texinputs/reportingbugs.tex \
-	../lib/libintro.tex \
-	../lib/libobjs.tex \
-	../lib/libstdtypes.tex \
-	../lib/libexcs.tex \
-	../lib/libfuncs.tex \
-	../lib/libpython.tex \
-	../lib/libsys.tex \
-	../lib/libfpectl.tex \
-	../lib/libgc.tex \
-	../lib/libweakref.tex \
-	../lib/libdifflib.tex \
-	../lib/libdoctest.tex \
-	../lib/libtypes.tex \
-	../lib/libtraceback.tex \
-	../lib/libpickle.tex \
-	../lib/libshelve.tex \
-	../lib/libcopy.tex \
-	../lib/libmarshal.tex \
-	../lib/libwarnings.tex \
-	../lib/libimp.tex \
-	../lib/libparser.tex \
-	../lib/libbltin.tex \
-	../lib/libmain.tex \
-	../lib/libstrings.tex \
-	../lib/libstring.tex \
-	../lib/libcodecs.tex \
-	../lib/libunicodedata.tex \
-	../lib/libstruct.tex \
-	../lib/libmisc.tex \
-	../lib/libmath.tex \
-	../lib/librand.tex \
-	../lib/libwhrandom.tex \
-	../lib/libarray.tex \
-	../lib/liballos.tex \
-	../lib/libos.tex \
-	../lib/libtime.tex \
-	../lib/libgetopt.tex \
-	../lib/libtempfile.tex \
-	../lib/liberrno.tex \
-	../lib/libsomeos.tex \
-	../lib/libsignal.tex \
-	../lib/libsocket.tex \
-	../lib/libselect.tex \
-	../lib/libthread.tex \
-	../lib/libunix.tex \
-	../lib/libposix.tex \
-	../lib/libposixpath.tex \
-	../lib/libpwd.tex \
-	../lib/libgrp.tex \
-	../lib/libcrypt.tex \
-	../lib/libdbm.tex \
-	../lib/libgdbm.tex \
-	../lib/libtermios.tex \
-	../lib/libfcntl.tex \
-	../lib/libposixfile.tex \
-	../lib/libsyslog.tex \
-	../lib/libpdb.tex \
-	../lib/libprofile.tex \
-	../lib/libcgi.tex \
-	../lib/liburllib.tex \
-	../lib/libhttplib.tex \
-	../lib/libftplib.tex \
-	../lib/libgopherlib.tex \
-	../lib/libnntplib.tex \
-	../lib/liburlparse.tex \
-	../lib/libhtmllib.tex \
-	../lib/libsgmllib.tex \
-	../lib/librfc822.tex \
-	../lib/libmimetools.tex \
-	../lib/libmimewriter.tex \
-	../lib/libbinascii.tex \
-	../lib/libmm.tex \
-	../lib/libaudioop.tex \
-	../lib/libimageop.tex \
-	../lib/libaifc.tex \
-	../lib/libjpeg.tex \
-	../lib/librgbimg.tex \
-	../lib/libcrypto.tex \
-	../lib/libmd5.tex \
-	../lib/libsha.tex \
-	../lib/libmpz.tex \
-	../lib/librotor.tex \
-	../lib/libstdwin.tex \
-	../lib/libsgi.tex \
-	../lib/libal.tex \
-	../lib/libcd.tex \
-	../lib/libfl.tex \
-	../lib/libfm.tex \
-	../lib/libgl.tex \
-	../lib/libimgfile.tex \
-	../lib/libsun.tex \
-	../lib/libxdrlib.tex \
-	../lib/libimghdr.tex \
-	../lib/librestricted.tex \
-	../lib/librexec.tex \
-	../lib/libbastion.tex \
-	../lib/libformatter.tex \
-	../lib/liboperator.tex \
-	../lib/libsoundex.tex \
-	../lib/libresource.tex \
-	../lib/libstat.tex \
-	../lib/libstringio.tex \
-	../lib/libtoken.tex \
-	../lib/libundoc.tex \
-	../lib/libmailcap.tex \
-	../lib/libglob.tex \
-	../lib/libuser.tex \
-	../lib/libanydbm.tex \
-	../lib/libbsddb.tex \
-	../lib/libdbhash.tex \
-	../lib/librandom.tex \
-	../lib/libsite.tex \
-	../lib/libwhichdb.tex \
-	../lib/libbase64.tex \
-	../lib/libfnmatch.tex \
-	../lib/libquopri.tex \
-	../lib/libzlib.tex \
-	../lib/libsocksvr.tex \
-	../lib/libmailbox.tex \
-	../lib/libcommands.tex \
-	../lib/libcmath.tex \
-	../lib/libgzip.tex \
-	../lib/libzipfile.tex \
-	../lib/libpprint.tex \
-	../lib/libcode.tex \
-	../lib/libmimify.tex \
-	../lib/libre.tex \
-	../lib/libuserdict.tex \
-	../lib/libdis.tex \
-	../lib/libxmllib.tex \
-	../lib/libpyexpat.tex \
-	../lib/xmldom.tex \
-	../lib/xmldomminidom.tex \
-	../lib/xmldompulldom.tex \
-	../lib/xmlsax.tex \
-	../lib/xmlsaxhandler.tex \
-	../lib/xmlsaxutils.tex \
-	../lib/xmlsaxreader.tex \
-	../lib/libqueue.tex \
-	../lib/liblocale.tex \
-	../lib/libgettext.tex \
-	../lib/libbasehttp.tex \
-	../lib/libcookie.tex \
-	../lib/libcopyreg.tex \
-	../lib/libsymbol.tex \
-	../lib/libbinhex.tex \
-	../lib/libuu.tex \
-	../lib/libsunaudio.tex \
-	../lib/libfileinput.tex \
-	../lib/libxreadlines.tex \
-	../lib/libimaplib.tex \
-	../lib/libpoplib.tex \
-	../lib/libcalendar.tex \
-	../lib/libpopen2.tex \
-	../lib/libbisect.tex \
-	../lib/libmimetypes.tex \
-	../lib/libsmtplib.tex \
-	../lib/libcmd.tex \
-	../lib/libmultifile.tex \
-	../lib/libthreading.tex \
-	../lib/libwebbrowser.tex \
-	../lib/internet.tex \
-	../lib/netdata.tex \
-	../lib/markup.tex \
-	../lib/language.tex \
-	../lib/libpycompile.tex \
-	../lib/libcompileall.tex \
-	../lib/libshlex.tex \
-	../lib/libnetrc.tex \
-	../lib/librobotparser.tex \
-	../lib/libgetpass.tex \
-	../lib/libshutil.tex \
-	../lib/librepr.tex \
-	../lib/libmsvcrt.tex \
-	../lib/libwinreg.tex \
-	../lib/libwinsound.tex \
-	../lib/windows.tex \
-	../lib/libpyclbr.tex \
-	../lib/libtokenize.tex \
-	../lib/libtabnanny.tex \
-	../lib/libmhlib.tex \
-	../lib/libtelnetlib.tex \
-	../lib/libcolorsys.tex \
-	../lib/libfpformat.tex \
-	../lib/libcgihttp.tex \
-	../lib/libsimplehttp.tex \
-	../lib/liblinecache.tex \
-	../lib/libnew.tex \
-	../lib/libdircache.tex \
-	../lib/libfilecmp.tex \
-	../lib/libstatcache.tex \
-	../lib/libsunau.tex \
-	../lib/libwave.tex \
-	../lib/libchunk.tex \
-	../lib/libcodeop.tex \
-	../lib/libcurses.tex \
-	../lib/libascii.tex \
-	../lib/libdl.tex \
-	../lib/libmutex.tex \
-	../lib/libnis.tex \
-	../lib/libpipes.tex \
-	../lib/libpty.tex \
-	../lib/libreadline.tex \
-	../lib/librlcompleter.tex \
-	../lib/libsched.tex \
-	../lib/libstatvfs.tex \
-	../lib/libtty.tex \
-	../lib/libasyncore.tex \
-	../lib/libatexit.tex \
-	../lib/libmmap.tex \
-	../lib/libcfgparser.tex
+	lib/lib.tex \
+	texinputs/reportingbugs.tex \
+	lib/libintro.tex \
+	lib/libobjs.tex \
+	lib/libstdtypes.tex \
+	lib/libexcs.tex \
+	lib/libfuncs.tex \
+	lib/libpython.tex \
+	lib/libsys.tex \
+	lib/libfpectl.tex \
+	lib/libgc.tex \
+	lib/libweakref.tex \
+	lib/libdifflib.tex \
+	lib/libdoctest.tex \
+	lib/libtypes.tex \
+	lib/libtraceback.tex \
+	lib/libpickle.tex \
+	lib/libshelve.tex \
+	lib/libcopy.tex \
+	lib/libmarshal.tex \
+	lib/libwarnings.tex \
+	lib/libimp.tex \
+	lib/libparser.tex \
+	lib/libbltin.tex \
+	lib/libmain.tex \
+	lib/libstrings.tex \
+	lib/libstring.tex \
+	lib/libcodecs.tex \
+	lib/libunicodedata.tex \
+	lib/libstruct.tex \
+	lib/libmisc.tex \
+	lib/libmath.tex \
+	lib/librand.tex \
+	lib/libwhrandom.tex \
+	lib/libarray.tex \
+	lib/liballos.tex \
+	lib/libos.tex \
+	lib/libtime.tex \
+	lib/libgetopt.tex \
+	lib/libtempfile.tex \
+	lib/liberrno.tex \
+	lib/libsomeos.tex \
+	lib/libsignal.tex \
+	lib/libsocket.tex \
+	lib/libselect.tex \
+	lib/libthread.tex \
+	lib/libunix.tex \
+	lib/libposix.tex \
+	lib/libposixpath.tex \
+	lib/libpwd.tex \
+	lib/libgrp.tex \
+	lib/libcrypt.tex \
+	lib/libdbm.tex \
+	lib/libgdbm.tex \
+	lib/libtermios.tex \
+	lib/libfcntl.tex \
+	lib/libposixfile.tex \
+	lib/libsyslog.tex \
+	lib/libpdb.tex \
+	lib/libprofile.tex \
+	lib/libcgi.tex \
+	lib/liburllib.tex \
+	lib/libhttplib.tex \
+	lib/libftplib.tex \
+	lib/libgopherlib.tex \
+	lib/libnntplib.tex \
+	lib/liburlparse.tex \
+	lib/libhtmllib.tex \
+	lib/libsgmllib.tex \
+	lib/librfc822.tex \
+	lib/libmimetools.tex \
+	lib/libmimewriter.tex \
+	lib/libbinascii.tex \
+	lib/libmm.tex \
+	lib/libaudioop.tex \
+	lib/libimageop.tex \
+	lib/libaifc.tex \
+	lib/libjpeg.tex \
+	lib/librgbimg.tex \
+	lib/libcrypto.tex \
+	lib/libmd5.tex \
+	lib/libsha.tex \
+	lib/libmpz.tex \
+	lib/librotor.tex \
+	lib/libstdwin.tex \
+	lib/libsgi.tex \
+	lib/libal.tex \
+	lib/libcd.tex \
+	lib/libfl.tex \
+	lib/libfm.tex \
+	lib/libgl.tex \
+	lib/libimgfile.tex \
+	lib/libsun.tex \
+	lib/libxdrlib.tex \
+	lib/libimghdr.tex \
+	lib/librestricted.tex \
+	lib/librexec.tex \
+	lib/libbastion.tex \
+	lib/libformatter.tex \
+	lib/liboperator.tex \
+	lib/libsoundex.tex \
+	lib/libresource.tex \
+	lib/libstat.tex \
+	lib/libstringio.tex \
+	lib/libtoken.tex \
+	lib/libundoc.tex \
+	lib/libmailcap.tex \
+	lib/libglob.tex \
+	lib/libuser.tex \
+	lib/libanydbm.tex \
+	lib/libbsddb.tex \
+	lib/libdbhash.tex \
+	lib/librandom.tex \
+	lib/libsite.tex \
+	lib/libwhichdb.tex \
+	lib/libbase64.tex \
+	lib/libfnmatch.tex \
+	lib/libquopri.tex \
+	lib/libzlib.tex \
+	lib/libsocksvr.tex \
+	lib/libmailbox.tex \
+	lib/libcommands.tex \
+	lib/libcmath.tex \
+	lib/libgzip.tex \
+	lib/libzipfile.tex \
+	lib/libpprint.tex \
+	lib/libcode.tex \
+	lib/libmimify.tex \
+	lib/libre.tex \
+	lib/libuserdict.tex \
+	lib/libdis.tex \
+	lib/libxmllib.tex \
+	lib/libpyexpat.tex \
+	lib/xmldom.tex \
+	lib/xmldomminidom.tex \
+	lib/xmldompulldom.tex \
+	lib/xmlsax.tex \
+	lib/xmlsaxhandler.tex \
+	lib/xmlsaxutils.tex \
+	lib/xmlsaxreader.tex \
+	lib/libqueue.tex \
+	lib/liblocale.tex \
+	lib/libgettext.tex \
+	lib/libbasehttp.tex \
+	lib/libcookie.tex \
+	lib/libcopyreg.tex \
+	lib/libsymbol.tex \
+	lib/libbinhex.tex \
+	lib/libuu.tex \
+	lib/libsunaudio.tex \
+	lib/libfileinput.tex \
+	lib/libxreadlines.tex \
+	lib/libimaplib.tex \
+	lib/libpoplib.tex \
+	lib/libcalendar.tex \
+	lib/libpopen2.tex \
+	lib/libbisect.tex \
+	lib/libmimetypes.tex \
+	lib/libsmtplib.tex \
+	lib/libcmd.tex \
+	lib/libmultifile.tex \
+	lib/libthreading.tex \
+	lib/libwebbrowser.tex \
+	lib/internet.tex \
+	lib/netdata.tex \
+	lib/markup.tex \
+	lib/language.tex \
+	lib/libpycompile.tex \
+	lib/libcompileall.tex \
+	lib/libshlex.tex \
+	lib/libnetrc.tex \
+	lib/librobotparser.tex \
+	lib/libgetpass.tex \
+	lib/libshutil.tex \
+	lib/librepr.tex \
+	lib/libmsvcrt.tex \
+	lib/libwinreg.tex \
+	lib/libwinsound.tex \
+	lib/windows.tex \
+	lib/libpyclbr.tex \
+	lib/libtokenize.tex \
+	lib/libtabnanny.tex \
+	lib/libmhlib.tex \
+	lib/libtelnetlib.tex \
+	lib/libcolorsys.tex \
+	lib/libfpformat.tex \
+	lib/libcgihttp.tex \
+	lib/libsimplehttp.tex \
+	lib/liblinecache.tex \
+	lib/libnew.tex \
+	lib/libdircache.tex \
+	lib/libfilecmp.tex \
+	lib/libstatcache.tex \
+	lib/libsunau.tex \
+	lib/libwave.tex \
+	lib/libchunk.tex \
+	lib/libcodeop.tex \
+	lib/libcurses.tex \
+	lib/libascii.tex \
+	lib/libdl.tex \
+	lib/libmutex.tex \
+	lib/libnis.tex \
+	lib/libpipes.tex \
+	lib/libpty.tex \
+	lib/libreadline.tex \
+	lib/librlcompleter.tex \
+	lib/libsched.tex \
+	lib/libstatvfs.tex \
+	lib/libtty.tex \
+	lib/libasyncore.tex \
+	lib/libatexit.tex \
+	lib/libmmap.tex \
+	lib/libcfgparser.tex
 
 # LaTeX source files for Macintosh Library Modules.
 MACFILES= $(HOWTOSTYLES) $(COMMONTEX) \
-	../mac/mac.tex \
-	../mac/using.tex \
-	../mac/toolbox.tex \
-	../mac/undoc.tex \
-	../mac/libmac.tex \
-	../mac/libaepack.tex \
-	../mac/libaetypes.tex \
-	../mac/libctb.tex \
-	../mac/libmacdnr.tex \
-	../mac/libmacfs.tex \
-	../mac/libmacos.tex \
-	../mac/libmacostools.tex \
-	../mac/libmactcp.tex \
-	../mac/libmacspeech.tex \
-	../mac/libmacui.tex \
-	../mac/libmacic.tex \
-	../mac/libframework.tex \
-	../mac/libminiae.tex
+	mac/mac.tex \
+	mac/using.tex \
+	mac/toolbox.tex \
+	mac/undoc.tex \
+	mac/libmac.tex \
+	mac/libaepack.tex \
+	mac/libaetypes.tex \
+	mac/libctb.tex \
+	mac/libmacdnr.tex \
+	mac/libmacfs.tex \
+	mac/libmacos.tex \
+	mac/libmacostools.tex \
+	mac/libmactcp.tex \
+	mac/libmacspeech.tex \
+	mac/libmacui.tex \
+	mac/libmacic.tex \
+	mac/libframework.tex \
+	mac/libminiae.tex
 
-INSTFILES = $(HOWTOSTYLES) $(COMMONTEX) ../inst/inst.tex
+INSTFILES = $(HOWTOSTYLES) $(COMMONTEX) inst/inst.tex
 
-DISTFILES = $(HOWTOSTYLES) $(COMMONTEX) ../dist/dist.tex
+DISTFILES = $(HOWTOSTYLES) $(COMMONTEX) dist/dist.tex