blob: 4cd8423df78d76470eb495dc820bdd027ce091ca [file] [log] [blame]
Fred Drakeb9b4c5b2000-08-31 06:12:35 +00001# Convenience Makefile for building HTML documentation. You probably
2# need to set TEXINPUTS from the command line for this to be useful,
3# unless you actually build the .dvi files in the top level directory.
Fred Drake60515f41998-05-07 14:50:22 +00004
Fred Drake07b12f21998-08-12 17:06:03 +00005PAPER=letter
Fred Drakef832f4c1998-08-11 19:36:35 +00006TOPDIR=..
Fred Drake07b12f21998-08-12 17:06:03 +00007TOOLSDIR=$(TOPDIR)/tools
8PAPERDIR=$(TOPDIR)/paper-$(PAPER)
Fred Drakef832f4c1998-08-11 19:36:35 +00009
Fred Drake07b12f21998-08-12 17:06:03 +000010TEXINPUTS=$(TOPDIR)/paper-$(PAPER):$(TOPDIR)/texinputs:
11
12# Where are the various programs?
Fred Drake4d33e4e1999-02-15 19:29:08 +000013PYTHON= python
14WEBCHECKER=$(PYTHON) $(TOPDIR)/../Tools/webchecker/webchecker.py
Fred Drake501b9262000-08-31 07:00:17 +000015MKHOWTO= $(TOOLSDIR)/mkhowto --about $(TOPDIR)/html/stdabout.dat \
Fred Drake5dc61042000-09-12 19:53:18 +000016 --address $(PYTHONDOCS) --up-link ../index.html \
Fred Drake42181db2001-01-09 22:02:10 +000017 --up-title "Python Documentation Index" \
18 --global-module-index "../modindex.html"
Fred Drake501b9262000-08-31 07:00:17 +000019MKHTML= $(MKHOWTO) --html
Fred Drake07b12f21998-08-12 17:06:03 +000020
Fred Drake4d33e4e1999-02-15 19:29:08 +000021BUILDINDEX=$(TOOLSDIR)/buildindex.py
Fred Drake5d56d361999-01-05 15:49:39 +000022
Fred Drakee4359952000-10-25 16:12:04 +000023PYTHONDOCS='See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.'
Fred Drake4d33e4e1999-02-15 19:29:08 +000024HTMLBASE= file:`pwd`
Fred Drake5761b761999-02-12 21:42:23 +000025
Fred Drake07b12f21998-08-12 17:06:03 +000026INDEXFILES=api/api.html \
Fred Drake1468d771999-03-18 19:07:04 +000027 doc/doc.html \
Fred Drake07b12f21998-08-12 17:06:03 +000028 ext/ext.html \
29 lib/lib.html \
30 mac/mac.html \
31 ref/ref.html \
Greg Ward0784c332000-04-28 17:03:26 +000032 tut/tut.html \
33 inst/inst.html \
34 dist/dist.html
Fred Drake07b12f21998-08-12 17:06:03 +000035
36COMMONPERL= $(TOPDIR)/perl/manual.perl \
Fred Drake54c52051998-08-13 19:03:19 +000037 $(TOPDIR)/perl/python.perl \
38 $(TOPDIR)/perl/l2hinit.perl
Fred Drakef832f4c1998-08-11 19:36:35 +000039
40
Fred Drake87d4a032000-10-09 18:56:23 +000041all: $(INDEXFILES) index.html modindex.html acks.html
Fred Drake07b12f21998-08-12 17:06:03 +000042
Greg Ward0784c332000-04-28 17:03:26 +000043.PHONY: api ext lib mac ref tut inst dist
Fred Drake07b12f21998-08-12 17:06:03 +000044
Fred Drake6f9dd5d1999-02-15 21:43:55 +000045api: api/api.html
Fred Drake766e0cb1999-04-05 19:28:29 +000046doc: doc/doc.html
Fred Drake6f9dd5d1999-02-15 21:43:55 +000047ext: ext/ext.html
48lib: lib/lib.html
49mac: mac/mac.html
50ref: ref/ref.html
51tut: tut/tut.html
Greg Ward0784c332000-04-28 17:03:26 +000052inst: inst/inst.html
53dist: dist/dist.html
Fred Drake07b12f21998-08-12 17:06:03 +000054
Fred Drakee15956b2000-04-03 04:51:13 +000055$(INDEXFILES): $(COMMONPERL) \
56 $(TOPDIR)/html/about.dat \
57 $(TOPDIR)/tools/node2label.pl
Fred Drake07b12f21998-08-12 17:06:03 +000058
Fred Drakef4070632000-08-11 17:36:21 +000059include ../Makefile.deps
60
Fred Drake664c72f1999-04-29 17:04:21 +000061# The index.html target is at the end since it screws up font-lock.
62
Fred Drake3705e592000-10-05 05:16:56 +000063acks.html: ../ACKS $(TOOLSDIR)/support.py $(TOOLSDIR)/mkackshtml
64 $(TOOLSDIR)/mkackshtml --address $(PYTHONDOCS) --output acks.html \
65 <../ACKS
66
67modindex.html: $(TOOLSDIR)/support.py $(TOOLSDIR)/mkmodindex
68modindex.html: lib/lib.html mac/mac.html
Fred Drake368b16a1999-03-02 15:56:19 +000069 $(TOOLSDIR)/mkmodindex --columns 4 --output modindex.html \
Fred Drakeb41f97d1999-03-04 21:25:05 +000070 --address $(PYTHONDOCS) \
Fred Drake684f78f1999-02-24 17:34:12 +000071 lib/modindex.html mac/modindex.html
72
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000073api/api.html: $(APIFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000074 $(MKHTML) $(TOPDIR)/api/api.tex
Fred Drake07b12f21998-08-12 17:06:03 +000075
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000076doc/doc.html: $(DOCFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000077 $(MKHTML) $(TOPDIR)/doc/doc.tex
Fred Drake1468d771999-03-18 19:07:04 +000078
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000079ext/ext.html: $(EXTFILES)
Fred Drake501b9262000-08-31 07:00:17 +000080 $(MKHTML) $(TOPDIR)/ext/ext.tex
Fred Drake07b12f21998-08-12 17:06:03 +000081
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000082lib/lib.html: $(LIBFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000083 $(MKHTML) $(TOPDIR)/lib/lib.tex
Fred Drake07b12f21998-08-12 17:06:03 +000084
Fred Drake5d56d361999-01-05 15:49:39 +000085mac/mac.html: $(MACFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000086 $(MKHTML) $(TOPDIR)/mac/mac.tex
Fred Drake07b12f21998-08-12 17:06:03 +000087
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000088ref/ref.html: $(REFFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000089 $(MKHTML) $(TOPDIR)/ref/ref.tex
Fred Drake07b12f21998-08-12 17:06:03 +000090
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000091tut/tut.html: $(TUTFILES) $(TOOLSDIR)/mkhowto
Fred Drake501b9262000-08-31 07:00:17 +000092 $(MKHTML) --numeric --split 3 $(TOPDIR)/tut/tut.tex
Fred Drakef832f4c1998-08-11 19:36:35 +000093
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000094inst/inst.html: $(INSTFILES) $(TOPDIR)/perl/distutils.perl
Fred Drake501b9262000-08-31 07:00:17 +000095 $(MKHTML) $(TOPDIR)/inst/inst.tex
Greg Ward0784c332000-04-28 17:03:26 +000096
97dist/dist.html:$(DISTFILES) $(TOPDIR)/perl/distutils.perl
Fred Drake501b9262000-08-31 07:00:17 +000098 $(MKHTML) $(TOPDIR)/dist/dist.tex
Fred Drake60515f41998-05-07 14:50:22 +000099
Fred Drake4d33e4e1999-02-15 19:29:08 +0000100webcheck: all
101 $(WEBCHECKER) $(HTMLBASE)/api/
Fred Drake1468d771999-03-18 19:07:04 +0000102 $(WEBCHECKER) $(HTMLBASE)/doc/
Fred Drake4d33e4e1999-02-15 19:29:08 +0000103 $(WEBCHECKER) $(HTMLBASE)/ext/
104 $(WEBCHECKER) -m290000 $(HTMLBASE)/lib/
105 $(WEBCHECKER) $(HTMLBASE)/mac/
106 $(WEBCHECKER) $(HTMLBASE)/ref/
107 $(WEBCHECKER) $(HTMLBASE)/tut/
Greg Ward0784c332000-04-28 17:03:26 +0000108 $(WEBCHECKER) $(HTMLBASE)/dist/
109 $(WEBCHECKER) $(HTMLBASE)/inst/
Fred Drake07b12f21998-08-12 17:06:03 +0000110
111clean:
Fred Drake6f9dd5d1999-02-15 21:43:55 +0000112 rm -rf @webchecker.pickle
Fred Drake07b12f21998-08-12 17:06:03 +0000113
Fred Drake532998e1999-09-24 13:51:19 +0000114distclean realclean clobber: clean
Fred Drake3705e592000-10-05 05:16:56 +0000115 rm -rf index.html modindex.html acks.html
Greg Ward0784c332000-04-28 17:03:26 +0000116 rm -rf api/ doc/ ext/ lib/ mac/ ref/ tut/ inst/ dist/
Fred Drake664c72f1999-04-29 17:04:21 +0000117
118
119# This is really ugly, but we're not dependent on $(RELEASE), which isn't
120# defined here. It also maintains the proper dependency on boilerplate.tex.
121
122# It's at the end of the file since it wedges font-lock in XEmacs.
123
124BOILERPLATE=$(TOPDIR)/texinputs/boilerplate.tex
Fred Drakeb9b4c5b2000-08-31 06:12:35 +0000125index.html: $(TOPDIR)/html/index.html.in $(BOILERPLATE)
Fred Drake0d6bf0e1999-11-18 20:56:29 +0000126 REL=`grep '\\release{' $(BOILERPLATE) | sed 's/.*\\release{\(.*\)}.*$$/\1/'`; \
127 REL=`echo "$$REL" | sed 's/[$$]//g'`; \
Fred Drake664c72f1999-04-29 17:04:21 +0000128 sed "s/@RELEASE@/$$REL/g" $< >TEMP
129 DATE=`grep '\\date{' $(BOILERPLATE) | sed 's/.*\\date{\(.*\)}.*$$/\1/'` ; \
Fred Drake0d6bf0e1999-11-18 20:56:29 +0000130 if [ "$$DATE" = '\today' ] ; then DATE=`date '+%B %e, %Y'`;fi;\
Fred Drake664c72f1999-04-29 17:04:21 +0000131 sed "s/@DATE@/$$DATE/g" TEMP >$@
132 rm -f TEMP