summaryrefslogtreecommitdiffstats
path: root/Doc/Makefile
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-02-19 19:19:26 (GMT)
committerFred Drake <fdrake@acm.org>2001-02-19 19:19:26 (GMT)
commitf6bfe8e34222445263308a1a46b16bb11204d634 (patch)
treed5f056bb85b5dc591454f0256ce690c15b4a872d /Doc/Makefile
parent50d1fcf61c792a0a8ae241f7f494c950990907d7 (diff)
downloadcpython-f6bfe8e34222445263308a1a46b16bb11204d634.zip
cpython-f6bfe8e34222445263308a1a46b16bb11204d634.tar.gz
cpython-f6bfe8e34222445263308a1a46b16bb11204d634.tar.bz2
Convert to a "flat" Makefile.
Diffstat (limited to 'Doc/Makefile')
-rw-r--r--Doc/Makefile312
1 files changed, 188 insertions, 124 deletions
diff --git a/Doc/Makefile b/Doc/Makefile
index 0bc2b2e..cd2129a 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -69,112 +69,148 @@ TOOLSDIR= tools
# 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)
-
-doc.ps:
- (cd paper-$(PAPER); $(MAKE) doc.ps)
-
-ext.ps:
- (cd paper-$(PAPER); $(MAKE) ext.ps)
-
-lib.ps:
- (cd paper-$(PAPER); $(MAKE) lib.ps)
-
-mac.ps:
- (cd paper-$(PAPER); $(MAKE) mac.ps)
-
-ref.ps:
- (cd paper-$(PAPER); $(MAKE) ref.ps)
-tut.ps:
- (cd paper-$(PAPER); $(MAKE) tut.ps)
-
-inst.ps:
- (cd paper-$(PAPER); $(MAKE) inst.ps)
-
-dist.ps:
- (cd paper-$(PAPER); $(MAKE) dist.ps)
-
-
-api.dvi:
- (cd paper-$(PAPER); $(MAKE) api.dvi)
-
-doc.dvi:
- (cd paper-$(PAPER); $(MAKE) doc.dvi)
+# Targets for each document:
+# Python/C API Reference Manual
+paper-$(PAPER)/api.dvi: paper-$(PAPER)/api.tex $(APIFILES)
+ (cd paper-$(PAPER); $(MKDVI) api.tex)
-ext.dvi:
- (cd paper-$(PAPER); $(MAKE) ext.dvi)
+paper-$(PAPER)/api.pdf: paper-$(PAPER)/api.tex $(APIFILES)
+ (cd paper-$(PAPER); $(MKPDF) api.tex)
-lib.dvi:
- (cd paper-$(PAPER); $(MAKE) lib.dvi)
+paper-$(PAPER)/api.tex: api/api.tex api/refcounts.dat tools/anno-api.py
+ $(PYTHON) $(TOOLSDIR)/anno-api.py -o $@ api/api.tex
-mac.dvi:
- (cd paper-$(PAPER); $(MAKE) mac.dvi)
+# Distributing Python Modules
+paper-$(PAPER)/dist.dvi: $(DISTFILES)
+ (cd paper-$(PAPER); $(MKDVI) ../dist/dist.tex)
-ref.dvi:
- (cd paper-$(PAPER); $(MAKE) ref.dvi)
+paper-$(PAPER)/dist.pdf: $(DISTFILES)
+ (cd paper-$(PAPER); $(MKPDF) ../dist/dist.tex
-tut.dvi:
- (cd paper-$(PAPER); $(MAKE) tut.dvi)
+# Documenting Python
+paper-$(PAPER)/doc.dvi: $(DOCFILES)
+ (cd paper-$(PAPER); $(MKDVI) ../doc/doc.tex
-inst.dvi:
- (cd paper-$(PAPER); $(MAKE) inst.dvi)
+paper-$(PAPER)/doc.pdf: $(DOCFILES)
+ (cd paper-$(PAPER); $(MKPDF) ../doc/doc.tex_
-dist.dvi:
- (cd paper-$(PAPER); $(MAKE) dist.dvi)
+# Extending and Embedding the Python Interpreter
+paper-$(PAPER)/ext.dvi: $(EXTFILES)
+ (cd paper-$(PAPER); $(MKDVI) ../ext/ext.tex)
+paper-$(PAPER)/ext.pdf: $(EXTFILES)
+ (cd paper-$(PAPER); $(MKPDF) ../ext/ext.tex)
-api.pdf:
- (cd paper-$(PAPER); $(MAKE) api.pdf)
+# Installing Python Modules
+paper-$(PAPER)/inst.dvi: $(INSTFILES)
+ (cd paper-$(PAPER); $(MKDVI) ../inst/inst.tex)
-doc.pdf:
- (cd paper-$(PAPER); $(MAKE) doc.pdf)
+paper-$(PAPER)/inst.pdf: $(INSTFILES)
+ (cd paper-$(PAPER); $(MKPDF) ../inst/inst.tex)
-ext.pdf:
- (cd paper-$(PAPER); $(MAKE) ext.pdf)
+# Python Library Reference
+paper-$(PAPER)/lib.dvi: $(LIBFILES)
+ (cd paper-$(PAPER); $(MKDVI) ../lib/lib.tex)
-lib.pdf:
- (cd paper-$(PAPER); $(MAKE) lib.pdf)
+paper-$(PAPER)/lib.pdf: $(LIBFILES)
+ (cd paper-$(PAPER); $(MKPDF) ../lib/lib.tex)
-mac.pdf:
- (cd paper-$(PAPER); $(MAKE) mac.pdf)
+# Macintosh Library Modules
+paper-$(PAPER)/mac.dvi: $(MACFILES)
+ (cd paper-$(PAPER); $(MKDVI) ../mac/mac.tex)
-ref.pdf:
- (cd paper-$(PAPER); $(MAKE) ref.pdf)
+paper-$(PAPER)/mac.pdf: $(MACFILES)
+ (cd paper-$(PAPER); $(MKPDF) ../mac/mac.tex)
-tut.pdf:
- (cd paper-$(PAPER); $(MAKE) tut.pdf)
+# Python Reference Manual
+paper-$(PAPER)/ref.dvi: $(REFFILES)
+ (cd paper-$(PAPER); $(MKDVI) ../ref/ref.tex)
-inst.pdf:
- (cd paper-$(PAPER); $(MAKE) inst.pdf)
+paper-$(PAPER)/ref.pdf: $(REFFILES)
+ (cd paper-$(PAPER); $(MKPDF) ../ref/ref.tex)
-dist.pdf:
- (cd paper-$(PAPER); $(MAKE) dist.pdf)
+# Python Tutorial
+paper-$(PAPER)/tut.dvi: $(TUTFILES)
+ (cd paper-$(PAPER); $(MKDVI) ../tut/tut.tex)
+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 @@ info:
# 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 @@ pdf-$(PAPER)-$(RELEASE).zip: pdf
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 @@ html-$(RELEASE).zip: html
(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 @@ tarlatex: latex-$(RELEASE).tgz
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 @@ distfiles: tarballs zips bzips
# - 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 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.
-realclean: clobber
-distclean: clobber
+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" \
+ $< >$@