blob: 6b2827bc7e8cf0f41805a069b1f3ba919c291788 [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 \
17 --up-title "Python Documentation Index"
Fred Drake501b9262000-08-31 07:00:17 +000018MKHTML= $(MKHOWTO) --html
Fred Drake07b12f21998-08-12 17:06:03 +000019
Fred Drake4d33e4e1999-02-15 19:29:08 +000020BUILDINDEX=$(TOOLSDIR)/buildindex.py
Fred Drake5d56d361999-01-05 15:49:39 +000021
Fred Drakee4359952000-10-25 16:12:04 +000022PYTHONDOCS='See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.'
Fred Drake4d33e4e1999-02-15 19:29:08 +000023HTMLBASE= file:`pwd`
Fred Drake5761b761999-02-12 21:42:23 +000024
Fred Drake07b12f21998-08-12 17:06:03 +000025INDEXFILES=api/api.html \
Fred Drake1468d771999-03-18 19:07:04 +000026 doc/doc.html \
Fred Drake07b12f21998-08-12 17:06:03 +000027 ext/ext.html \
28 lib/lib.html \
29 mac/mac.html \
30 ref/ref.html \
Greg Ward0784c332000-04-28 17:03:26 +000031 tut/tut.html \
32 inst/inst.html \
33 dist/dist.html
Fred Drake07b12f21998-08-12 17:06:03 +000034
35COMMONPERL= $(TOPDIR)/perl/manual.perl \
Fred Drake54c52051998-08-13 19:03:19 +000036 $(TOPDIR)/perl/python.perl \
37 $(TOPDIR)/perl/l2hinit.perl
Fred Drakef832f4c1998-08-11 19:36:35 +000038
39
Fred Drake87d4a032000-10-09 18:56:23 +000040all: $(INDEXFILES) index.html modindex.html acks.html
Fred Drake07b12f21998-08-12 17:06:03 +000041
Greg Ward0784c332000-04-28 17:03:26 +000042.PHONY: api ext lib mac ref tut inst dist
Fred Drake07b12f21998-08-12 17:06:03 +000043
Fred Drake6f9dd5d1999-02-15 21:43:55 +000044api: api/api.html
Fred Drake766e0cb1999-04-05 19:28:29 +000045doc: doc/doc.html
Fred Drake6f9dd5d1999-02-15 21:43:55 +000046ext: ext/ext.html
47lib: lib/lib.html
48mac: mac/mac.html
49ref: ref/ref.html
50tut: tut/tut.html
Greg Ward0784c332000-04-28 17:03:26 +000051inst: inst/inst.html
52dist: dist/dist.html
Fred Drake07b12f21998-08-12 17:06:03 +000053
Fred Drakee15956b2000-04-03 04:51:13 +000054$(INDEXFILES): $(COMMONPERL) \
55 $(TOPDIR)/html/about.dat \
56 $(TOPDIR)/tools/node2label.pl
Fred Drake07b12f21998-08-12 17:06:03 +000057
Fred Drakef4070632000-08-11 17:36:21 +000058include ../Makefile.deps
59
Fred Drake664c72f1999-04-29 17:04:21 +000060# The index.html target is at the end since it screws up font-lock.
61
Fred Drake3705e592000-10-05 05:16:56 +000062acks.html: ../ACKS $(TOOLSDIR)/support.py $(TOOLSDIR)/mkackshtml
63 $(TOOLSDIR)/mkackshtml --address $(PYTHONDOCS) --output acks.html \
64 <../ACKS
65
66modindex.html: $(TOOLSDIR)/support.py $(TOOLSDIR)/mkmodindex
67modindex.html: lib/lib.html mac/mac.html
Fred Drake368b16a1999-03-02 15:56:19 +000068 $(TOOLSDIR)/mkmodindex --columns 4 --output modindex.html \
Fred Drakeb41f97d1999-03-04 21:25:05 +000069 --address $(PYTHONDOCS) \
Fred Drake684f78f1999-02-24 17:34:12 +000070 lib/modindex.html mac/modindex.html
71
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000072api/api.html: $(APIFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000073 $(MKHTML) $(TOPDIR)/api/api.tex
Fred Drake07b12f21998-08-12 17:06:03 +000074
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000075doc/doc.html: $(DOCFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000076 $(MKHTML) $(TOPDIR)/doc/doc.tex
Fred Drake1468d771999-03-18 19:07:04 +000077
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000078ext/ext.html: $(EXTFILES)
79 echo $(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