blob: d0fb14013da44dca1b081990096cb016498bfb69 [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 \
16 --up-link ../index.html --up-title "Document Index" \
17 --address $(PYTHONDOCS)
18MKHTML= $(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 Drake5bd608d1999-10-29 20:51:43 +000022PYTHONDOCS='<hr>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 Drake5cc0a9b1999-04-29 15:42:19 +000040all: $(INDEXFILES) index.html modindex.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 Drake684f78f1999-02-24 17:34:12 +000062modindex.html: lib/lib.html mac/mac.html $(TOOLSDIR)/mkmodindex
Fred Drake368b16a1999-03-02 15:56:19 +000063 $(TOOLSDIR)/mkmodindex --columns 4 --output modindex.html \
Fred Drakeb41f97d1999-03-04 21:25:05 +000064 --address $(PYTHONDOCS) \
Fred Drake684f78f1999-02-24 17:34:12 +000065 lib/modindex.html mac/modindex.html
66
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000067api/api.html: $(APIFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000068 $(MKHTML) $(TOPDIR)/api/api.tex
Fred Drake07b12f21998-08-12 17:06:03 +000069
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000070doc/doc.html: $(DOCFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000071 $(MKHTML) $(TOPDIR)/doc/doc.tex
Fred Drake1468d771999-03-18 19:07:04 +000072
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000073ext/ext.html: $(EXTFILES)
74 echo $(EXTFILES)
Fred Drake501b9262000-08-31 07:00:17 +000075 $(MKHTML) $(TOPDIR)/ext/ext.tex
Fred Drake07b12f21998-08-12 17:06:03 +000076
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000077lib/lib.html: $(LIBFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000078 $(MKHTML) $(TOPDIR)/lib/lib.tex
Fred Drake07b12f21998-08-12 17:06:03 +000079
Fred Drake5d56d361999-01-05 15:49:39 +000080mac/mac.html: $(MACFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000081 $(MKHTML) $(TOPDIR)/mac/mac.tex
Fred Drake07b12f21998-08-12 17:06:03 +000082
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000083ref/ref.html: $(REFFILES) $(BUILDINDEX)
Fred Drake501b9262000-08-31 07:00:17 +000084 $(MKHTML) $(TOPDIR)/ref/ref.tex
Fred Drake07b12f21998-08-12 17:06:03 +000085
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000086tut/tut.html: $(TUTFILES) $(TOOLSDIR)/mkhowto
Fred Drake501b9262000-08-31 07:00:17 +000087 $(MKHTML) --numeric --split 3 $(TOPDIR)/tut/tut.tex
Fred Drakef832f4c1998-08-11 19:36:35 +000088
Fred Drakeb9b4c5b2000-08-31 06:12:35 +000089inst/inst.html: $(INSTFILES) $(TOPDIR)/perl/distutils.perl
Fred Drake501b9262000-08-31 07:00:17 +000090 $(MKHTML) $(TOPDIR)/inst/inst.tex
Greg Ward0784c332000-04-28 17:03:26 +000091
92dist/dist.html:$(DISTFILES) $(TOPDIR)/perl/distutils.perl
Fred Drake501b9262000-08-31 07:00:17 +000093 $(MKHTML) $(TOPDIR)/dist/dist.tex
Fred Drake60515f41998-05-07 14:50:22 +000094
Fred Drake4d33e4e1999-02-15 19:29:08 +000095webcheck: all
96 $(WEBCHECKER) $(HTMLBASE)/api/
Fred Drake1468d771999-03-18 19:07:04 +000097 $(WEBCHECKER) $(HTMLBASE)/doc/
Fred Drake4d33e4e1999-02-15 19:29:08 +000098 $(WEBCHECKER) $(HTMLBASE)/ext/
99 $(WEBCHECKER) -m290000 $(HTMLBASE)/lib/
100 $(WEBCHECKER) $(HTMLBASE)/mac/
101 $(WEBCHECKER) $(HTMLBASE)/ref/
102 $(WEBCHECKER) $(HTMLBASE)/tut/
Greg Ward0784c332000-04-28 17:03:26 +0000103 $(WEBCHECKER) $(HTMLBASE)/dist/
104 $(WEBCHECKER) $(HTMLBASE)/inst/
Fred Drake07b12f21998-08-12 17:06:03 +0000105
106clean:
Fred Drake6f9dd5d1999-02-15 21:43:55 +0000107 rm -rf @webchecker.pickle
Fred Drake07b12f21998-08-12 17:06:03 +0000108
Fred Drake532998e1999-09-24 13:51:19 +0000109distclean realclean clobber: clean
Greg Ward0784c332000-04-28 17:03:26 +0000110 rm -rf index.html modindex.html
111 rm -rf api/ doc/ ext/ lib/ mac/ ref/ tut/ inst/ dist/
Fred Drake664c72f1999-04-29 17:04:21 +0000112
113
114# This is really ugly, but we're not dependent on $(RELEASE), which isn't
115# defined here. It also maintains the proper dependency on boilerplate.tex.
116
117# It's at the end of the file since it wedges font-lock in XEmacs.
118
119BOILERPLATE=$(TOPDIR)/texinputs/boilerplate.tex
Fred Drakeb9b4c5b2000-08-31 06:12:35 +0000120index.html: $(TOPDIR)/html/index.html.in $(BOILERPLATE)
Fred Drake0d6bf0e1999-11-18 20:56:29 +0000121 REL=`grep '\\release{' $(BOILERPLATE) | sed 's/.*\\release{\(.*\)}.*$$/\1/'`; \
122 REL=`echo "$$REL" | sed 's/[$$]//g'`; \
Fred Drake664c72f1999-04-29 17:04:21 +0000123 sed "s/@RELEASE@/$$REL/g" $< >TEMP
124 DATE=`grep '\\date{' $(BOILERPLATE) | sed 's/.*\\date{\(.*\)}.*$$/\1/'` ; \
Fred Drake0d6bf0e1999-11-18 20:56:29 +0000125 if [ "$$DATE" = '\today' ] ; then DATE=`date '+%B %e, %Y'`;fi;\
Fred Drake664c72f1999-04-29 17:04:21 +0000126 sed "s/@DATE@/$$DATE/g" TEMP >$@
127 rm -f TEMP