blob: 0778fb86a427ec4da5b75493fe8f071dda19983c [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 Drakeb9b4c5b2000-08-31 06:12:35 +000015MKHOWTO= $(TOOLSDIR)/mkhowto
Fred Drake07b12f21998-08-12 17:06:03 +000016
Fred Drake4d33e4e1999-02-15 19:29:08 +000017BUILDINDEX=$(TOOLSDIR)/buildindex.py
Fred Drake5d56d361999-01-05 15:49:39 +000018
Fred Drake5bd608d1999-10-29 20:51:43 +000019PYTHONDOCS='<hr>See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.'
Fred Drake4d33e4e1999-02-15 19:29:08 +000020HTMLBASE= file:`pwd`
Fred Drake5761b761999-02-12 21:42:23 +000021
Fred Drake07b12f21998-08-12 17:06:03 +000022INDEXFILES=api/api.html \
Fred Drake1468d771999-03-18 19:07:04 +000023 doc/doc.html \
Fred Drake07b12f21998-08-12 17:06:03 +000024 ext/ext.html \
25 lib/lib.html \
26 mac/mac.html \
27 ref/ref.html \
Greg Ward0784c332000-04-28 17:03:26 +000028 tut/tut.html \
29 inst/inst.html \
30 dist/dist.html
Fred Drake07b12f21998-08-12 17:06:03 +000031
32COMMONPERL= $(TOPDIR)/perl/manual.perl \
Fred Drake54c52051998-08-13 19:03:19 +000033 $(TOPDIR)/perl/python.perl \
34 $(TOPDIR)/perl/l2hinit.perl
Fred Drakef832f4c1998-08-11 19:36:35 +000035
36
Fred Drake5cc0a9b1999-04-29 15:42:19 +000037all: $(INDEXFILES) index.html modindex.html
Fred Drake07b12f21998-08-12 17:06:03 +000038
Greg Ward0784c332000-04-28 17:03:26 +000039.PHONY: api ext lib mac ref tut inst dist
Fred Drake07b12f21998-08-12 17:06:03 +000040
Fred Drake6f9dd5d1999-02-15 21:43:55 +000041api: api/api.html
Fred Drake766e0cb1999-04-05 19:28:29 +000042doc: doc/doc.html
Fred Drake6f9dd5d1999-02-15 21:43:55 +000043ext: ext/ext.html
44lib: lib/lib.html
45mac: mac/mac.html
46ref: ref/ref.html
47tut: tut/tut.html
Greg Ward0784c332000-04-28 17:03:26 +000048inst: inst/inst.html
49dist: dist/dist.html
Fred Drake07b12f21998-08-12 17:06:03 +000050
Fred Drakee15956b2000-04-03 04:51:13 +000051$(INDEXFILES): $(COMMONPERL) \
52 $(TOPDIR)/html/about.dat \
53 $(TOPDIR)/tools/node2label.pl
Fred Drake07b12f21998-08-12 17:06:03 +000054
Fred Drakef4070632000-08-11 17:36:21 +000055include ../Makefile.deps
56
Fred Drake664c72f1999-04-29 17:04:21 +000057# The index.html target is at the end since it screws up font-lock.
58
Fred Drake684f78f1999-02-24 17:34:12 +000059modindex.html: lib/lib.html mac/mac.html $(TOOLSDIR)/mkmodindex
Fred Drake368b16a1999-03-02 15:56:19 +000060 $(TOOLSDIR)/mkmodindex --columns 4 --output modindex.html \
Fred Drakeb41f97d1999-03-04 21:25:05 +000061 --address $(PYTHONDOCS) \
Fred Drake684f78f1999-02-24 17:34:12 +000062 lib/modindex.html mac/modindex.html
63
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000064api/api.html: $(APIFILES) $(BUILDINDEX)
65 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
66 --html $(TOPDIR)/api/api.tex
Fred Drake07b12f21998-08-12 17:06:03 +000067
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000068doc/doc.html: $(DOCFILES) $(BUILDINDEX)
69 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
Fred Drake8903be61999-09-23 16:54:06 +000070 --html $(TOPDIR)/doc/doc.tex
Fred Drake1468d771999-03-18 19:07:04 +000071
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000072ext/ext.html: $(EXTFILES)
73 echo $(EXTFILES)
74 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
75 --html $(TOPDIR)/ext/ext.tex
Fred Drake07b12f21998-08-12 17:06:03 +000076
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000077lib/lib.html: $(LIBFILES) $(BUILDINDEX)
78 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
79 --html $(TOPDIR)/lib/lib.tex
Fred Drake07b12f21998-08-12 17:06:03 +000080
Fred Drake5d56d361999-01-05 15:49:39 +000081mac/mac.html: $(MACFILES) $(BUILDINDEX)
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000082 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
Fred Drake8903be61999-09-23 16:54:06 +000083 --html $(TOPDIR)/mac/mac.tex
Fred Drake07b12f21998-08-12 17:06:03 +000084
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000085ref/ref.html: $(REFFILES) $(BUILDINDEX)
86 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
87 --html $(TOPDIR)/ref/ref.tex
Fred Drake07b12f21998-08-12 17:06:03 +000088
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000089tut/tut.html: $(TUTFILES) $(TOOLSDIR)/mkhowto
90 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
91 --html --numeric --split 3 $(TOPDIR)/tut/tut.tex
Fred Drakef832f4c1998-08-11 19:36:35 +000092
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000093inst/inst.html: $(INSTFILES) $(TOPDIR)/perl/distutils.perl
94 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
Greg Ward0784c332000-04-28 17:03:26 +000095 --html $(TOPDIR)/inst/inst.tex
96
97dist/dist.html:$(DISTFILES) $(TOPDIR)/perl/distutils.perl
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000098 $(MKHOWTO) --about stdabout.dat --address $(PYTHONDOCS) \
Greg Ward0784c332000-04-28 17:03:26 +000099 --html $(TOPDIR)/dist/dist.tex
Fred Drake60515f41998-05-07 14:50:22 +0000100
Fred Drake4d33e4e1999-02-15 19:29:08 +0000101webcheck: all
102 $(WEBCHECKER) $(HTMLBASE)/api/
Fred Drake1468d771999-03-18 19:07:04 +0000103 $(WEBCHECKER) $(HTMLBASE)/doc/
Fred Drake4d33e4e1999-02-15 19:29:08 +0000104 $(WEBCHECKER) $(HTMLBASE)/ext/
105 $(WEBCHECKER) -m290000 $(HTMLBASE)/lib/
106 $(WEBCHECKER) $(HTMLBASE)/mac/
107 $(WEBCHECKER) $(HTMLBASE)/ref/
108 $(WEBCHECKER) $(HTMLBASE)/tut/
Greg Ward0784c332000-04-28 17:03:26 +0000109 $(WEBCHECKER) $(HTMLBASE)/dist/
110 $(WEBCHECKER) $(HTMLBASE)/inst/
Fred Drake07b12f21998-08-12 17:06:03 +0000111
112clean:
Fred Drake6f9dd5d1999-02-15 21:43:55 +0000113 rm -rf @webchecker.pickle
Fred Drake07b12f21998-08-12 17:06:03 +0000114
Fred Drake532998e1999-09-24 13:51:19 +0000115distclean realclean clobber: clean
Greg Ward0784c332000-04-28 17:03:26 +0000116 rm -rf index.html modindex.html
117 rm -rf api/ doc/ ext/ lib/ mac/ ref/ tut/ inst/ dist/
Fred Drake664c72f1999-04-29 17:04:21 +0000118
119
120# This is really ugly, but we're not dependent on $(RELEASE), which isn't
121# defined here. It also maintains the proper dependency on boilerplate.tex.
122
123# It's at the end of the file since it wedges font-lock in XEmacs.
124
125BOILERPLATE=$(TOPDIR)/texinputs/boilerplate.tex
Fred Drakeb9b4c5b2000-08-31 06:12:35 +0000126index.html: $(TOPDIR)/html/index.html.in $(BOILERPLATE)
Fred Drake0d6bf0e1999-11-18 20:56:29 +0000127 REL=`grep '\\release{' $(BOILERPLATE) | sed 's/.*\\release{\(.*\)}.*$$/\1/'`; \
128 REL=`echo "$$REL" | sed 's/[$$]//g'`; \
Fred Drake664c72f1999-04-29 17:04:21 +0000129 sed "s/@RELEASE@/$$REL/g" $< >TEMP
130 DATE=`grep '\\date{' $(BOILERPLATE) | sed 's/.*\\date{\(.*\)}.*$$/\1/'` ; \
Fred Drake0d6bf0e1999-11-18 20:56:29 +0000131 if [ "$$DATE" = '\today' ] ; then DATE=`date '+%B %e, %Y'`;fi;\
Fred Drake664c72f1999-04-29 17:04:21 +0000132 sed "s/@DATE@/$$DATE/g" TEMP >$@
133 rm -f TEMP