blob: 1d322bd7e84387797e264a7aae41a16859b1b86c [file] [log] [blame]
Fred Drake60515f41998-05-07 14:50:22 +00001# Convenience Makefile for building HTML documentation. You probably need to
2# set TEXINPUTS from the command line for this to be useful, unless you
3# actually build the .dvi files in the top level directory.
4#
5# Note that the .dvi files must already be built and TEXINPUTS must include the
6# directory where latex's working files (esp. *.aux) are kept.
7
Fred Drake07b12f21998-08-12 17:06:03 +00008PAPER=letter
Fred Drakef832f4c1998-08-11 19:36:35 +00009TOPDIR=..
Fred Drake07b12f21998-08-12 17:06:03 +000010TOOLSDIR=$(TOPDIR)/tools
11PAPERDIR=$(TOPDIR)/paper-$(PAPER)
Fred Drakef832f4c1998-08-11 19:36:35 +000012
Fred Drake07b12f21998-08-12 17:06:03 +000013TEXINPUTS=$(TOPDIR)/paper-$(PAPER):$(TOPDIR)/texinputs:
14
15# Where are the various programs?
Fred Drake4d33e4e1999-02-15 19:29:08 +000016PYTHON= python
17WEBCHECKER=$(PYTHON) $(TOPDIR)/../Tools/webchecker/webchecker.py
18MKAUX= PAPER=$(PAPER) TEXINPUTS=$(TEXINPUTS) $(TOOLSDIR)/mkdvi.sh --aux
19MKHTML= PAPER=$(PAPER) $(TOOLSDIR)/mkhtml.sh
20KPSEWHICH= TEXINPUTS=$(TEXINPUTS) kpsewhich tex
Fred Drake07b12f21998-08-12 17:06:03 +000021
Fred Drake4d33e4e1999-02-15 19:29:08 +000022BUILDINDEX=$(TOOLSDIR)/buildindex.py
Fred Drake5d56d361999-01-05 15:49:39 +000023
Fred Drake5761b761999-02-12 21:42:23 +000024# make it clear to l2h, since our support only generates HTML 4.0
Fred Drake4d33e4e1999-02-15 19:29:08 +000025L2HARGS= -html_version 4.0
26
Fred Drake4050e001999-04-28 15:06:08 +000027PYTHONDOCS='<hr>Send comments on this document to <a href="mailto:python-docs@python.org">python-docs@python.org</a>.'
Fred Drake4d33e4e1999-02-15 19:29:08 +000028HTMLBASE= file:`pwd`
Fred Drake5761b761999-02-12 21:42:23 +000029
Fred Drake07b12f21998-08-12 17:06:03 +000030INDEXFILES=api/api.html \
Fred Drake1468d771999-03-18 19:07:04 +000031 doc/doc.html \
Fred Drake07b12f21998-08-12 17:06:03 +000032 ext/ext.html \
33 lib/lib.html \
34 mac/mac.html \
35 ref/ref.html \
36 tut/tut.html
37
38COMMONPERL= $(TOPDIR)/perl/manual.perl \
Fred Drake54c52051998-08-13 19:03:19 +000039 $(TOPDIR)/perl/python.perl \
40 $(TOPDIR)/perl/l2hinit.perl
Fred Drakef832f4c1998-08-11 19:36:35 +000041
42
Fred Drake5cc0a9b1999-04-29 15:42:19 +000043all: $(INDEXFILES) index.html modindex.html
Fred Drake07b12f21998-08-12 17:06:03 +000044
45.PHONY: api ext lib mac ref tut
46
Fred Drake6f9dd5d1999-02-15 21:43:55 +000047api: api/api.html
Fred Drake766e0cb1999-04-05 19:28:29 +000048doc: doc/doc.html
Fred Drake6f9dd5d1999-02-15 21:43:55 +000049ext: ext/ext.html
50lib: lib/lib.html
51mac: mac/mac.html
52ref: ref/ref.html
53tut: tut/tut.html
Fred Drake07b12f21998-08-12 17:06:03 +000054
Fred Drakea8ba3641998-11-30 20:28:35 +000055$(INDEXFILES): $(COMMONPERL) $(TOPDIR)/html/about.dat
Fred Drake07b12f21998-08-12 17:06:03 +000056
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 Drake5d56d361999-01-05 15:49:39 +000064api/api.html: $(PAPERDIR)/api.aux $(BUILDINDEX)
Fred Drake07b12f21998-08-12 17:06:03 +000065 $(MKHTML) api $(L2HARGS)
66
Fred Drake1468d771999-03-18 19:07:04 +000067doc/doc.html: $(DOCFILES) $(BUILDINDEX) $(TOPDIR)/perl/ltxmarkup.perl
68 $(TOOLSDIR)/mkhowto --address $(PYTHONDOCS) --html \
69 $(TOPDIR)/doc/doc.tex
70
Fred Drake07b12f21998-08-12 17:06:03 +000071ext/ext.html: $(PAPERDIR)/ext.aux
72 $(MKHTML) ext $(L2HARGS)
73
Fred Drake5d56d361999-01-05 15:49:39 +000074lib/lib.html: $(PAPERDIR)/lib.aux $(BUILDINDEX)
Fred Drake07b12f21998-08-12 17:06:03 +000075 $(TOOLSDIR)/fix_libaux.sed <`$(KPSEWHICH) lib.aux` >lib1.aux
76 mv lib1.aux `$(KPSEWHICH) lib.aux`
77 $(MKHTML) lib $(L2HARGS)
78
Fred Drake5d56d361999-01-05 15:49:39 +000079mac/mac.html: $(MACFILES) $(BUILDINDEX)
Fred Drakeb41f97d1999-03-04 21:25:05 +000080 $(TOOLSDIR)/mkhowto --address $(PYTHONDOCS) --html \
81 $(TOPDIR)/mac/mac.tex
Fred Drake07b12f21998-08-12 17:06:03 +000082
Fred Drake5d56d361999-01-05 15:49:39 +000083ref/ref.html: $(PAPERDIR)/ref.aux $(BUILDINDEX)
Fred Drake07b12f21998-08-12 17:06:03 +000084 $(MKHTML) ref $(L2HARGS)
85
86tut/tut.html: $(PAPERDIR)/tut.aux
Fred Drake664c72f1999-04-29 17:04:21 +000087 $(MKHTML) tut $(L2HARGS) -split 4
Fred Drakef832f4c1998-08-11 19:36:35 +000088
Fred Drake60515f41998-05-07 14:50:22 +000089
Fred Drake2e23c311998-10-07 22:03:45 +000090include ../Makefile.deps
91
Fred Drake07b12f21998-08-12 17:06:03 +000092$(PAPERDIR)/api.aux: $(APIFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +000093 (cd $(PAPERDIR); $(MKAUX) api)
Fred Drake60515f41998-05-07 14:50:22 +000094
Fred Drake07b12f21998-08-12 17:06:03 +000095$(PAPERDIR)/ext.aux: $(EXTFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +000096 (cd $(PAPERDIR); $(MKAUX) ext)
Fred Drake60515f41998-05-07 14:50:22 +000097
Fred Drake07b12f21998-08-12 17:06:03 +000098$(PAPERDIR)/lib.aux: $(LIBFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +000099 (cd $(PAPERDIR); $(MKAUX) lib)
Fred Drake60515f41998-05-07 14:50:22 +0000100
Fred Drake07b12f21998-08-12 17:06:03 +0000101$(PAPERDIR)/ref.aux: $(REFFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +0000102 (cd $(PAPERDIR); $(MKAUX) ref)
Fred Drake60515f41998-05-07 14:50:22 +0000103
Fred Drake07b12f21998-08-12 17:06:03 +0000104$(PAPERDIR)/tut.aux: $(TUTFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +0000105 (cd $(PAPERDIR); $(MKAUX) tut)
Fred Drake60515f41998-05-07 14:50:22 +0000106
Fred Drake07b12f21998-08-12 17:06:03 +0000107
Fred Drake4d33e4e1999-02-15 19:29:08 +0000108webcheck: all
109 $(WEBCHECKER) $(HTMLBASE)/api/
Fred Drake1468d771999-03-18 19:07:04 +0000110 $(WEBCHECKER) $(HTMLBASE)/doc/
Fred Drake4d33e4e1999-02-15 19:29:08 +0000111 $(WEBCHECKER) $(HTMLBASE)/ext/
112 $(WEBCHECKER) -m290000 $(HTMLBASE)/lib/
113 $(WEBCHECKER) $(HTMLBASE)/mac/
114 $(WEBCHECKER) $(HTMLBASE)/ref/
115 $(WEBCHECKER) $(HTMLBASE)/tut/
Fred Drake07b12f21998-08-12 17:06:03 +0000116
117clean:
Fred Drake6f9dd5d1999-02-15 21:43:55 +0000118 rm -rf @webchecker.pickle
Fred Drake07b12f21998-08-12 17:06:03 +0000119
120clobber: clean
Fred Drake664c72f1999-04-29 17:04:21 +0000121 rm -rf index.html api/ doc/ ext/ lib/ mac/ ref/ tut/
122
123
124# This is really ugly, but we're not dependent on $(RELEASE), which isn't
125# defined here. It also maintains the proper dependency on boilerplate.tex.
126
127# It's at the end of the file since it wedges font-lock in XEmacs.
128
129BOILERPLATE=$(TOPDIR)/texinputs/boilerplate.tex
130index.html: index.html.in $(BOILERPLATE)
131 REL=`grep '\\release{' $(BOILERPLATE) | sed 's/.*\\release{\(.*\)}.*$$/\1/'` ; \
132 sed "s/@RELEASE@/$$REL/g" $< >TEMP
133 DATE=`grep '\\date{' $(BOILERPLATE) | sed 's/.*\\date{\(.*\)}.*$$/\1/'` ; \
134 sed "s/@DATE@/$$DATE/g" TEMP >$@
135 rm -f TEMP
136