blob: 2115132aea5f427e8de6ab797ff1ce4b512971cc [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
Fred Drake50c507e1999-04-29 19:04:55 +000018WCNEW=$(PYTHON) $(TOPDIR)/../Tools/webchecker/wcnew.py
Fred Drake4d33e4e1999-02-15 19:29:08 +000019MKAUX= PAPER=$(PAPER) TEXINPUTS=$(TEXINPUTS) $(TOOLSDIR)/mkdvi.sh --aux
20MKHTML= PAPER=$(PAPER) $(TOOLSDIR)/mkhtml.sh
21KPSEWHICH= TEXINPUTS=$(TEXINPUTS) kpsewhich tex
Fred Drake07b12f21998-08-12 17:06:03 +000022
Fred Drake4d33e4e1999-02-15 19:29:08 +000023BUILDINDEX=$(TOOLSDIR)/buildindex.py
Fred Drake5d56d361999-01-05 15:49:39 +000024
Fred Drake5761b761999-02-12 21:42:23 +000025# make it clear to l2h, since our support only generates HTML 4.0
Fred Drake4d33e4e1999-02-15 19:29:08 +000026L2HARGS= -html_version 4.0
27
Fred Drake5bd608d1999-10-29 20:51:43 +000028PYTHONDOCS='<hr>See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.'
Fred Drake4d33e4e1999-02-15 19:29:08 +000029HTMLBASE= file:`pwd`
Fred Drake5761b761999-02-12 21:42:23 +000030
Fred Drake07b12f21998-08-12 17:06:03 +000031INDEXFILES=api/api.html \
Fred Drake1468d771999-03-18 19:07:04 +000032 doc/doc.html \
Fred Drake07b12f21998-08-12 17:06:03 +000033 ext/ext.html \
34 lib/lib.html \
35 mac/mac.html \
36 ref/ref.html \
Greg Ward0784c332000-04-28 17:03:26 +000037 tut/tut.html \
38 inst/inst.html \
39 dist/dist.html
Fred Drake07b12f21998-08-12 17:06:03 +000040
41COMMONPERL= $(TOPDIR)/perl/manual.perl \
Fred Drake54c52051998-08-13 19:03:19 +000042 $(TOPDIR)/perl/python.perl \
43 $(TOPDIR)/perl/l2hinit.perl
Fred Drakef832f4c1998-08-11 19:36:35 +000044
45
Fred Drake5cc0a9b1999-04-29 15:42:19 +000046all: $(INDEXFILES) index.html modindex.html
Fred Drake07b12f21998-08-12 17:06:03 +000047
Greg Ward0784c332000-04-28 17:03:26 +000048.PHONY: api ext lib mac ref tut inst dist
Fred Drake07b12f21998-08-12 17:06:03 +000049
Fred Drake6f9dd5d1999-02-15 21:43:55 +000050api: api/api.html
Fred Drake766e0cb1999-04-05 19:28:29 +000051doc: doc/doc.html
Fred Drake6f9dd5d1999-02-15 21:43:55 +000052ext: ext/ext.html
53lib: lib/lib.html
54mac: mac/mac.html
55ref: ref/ref.html
56tut: tut/tut.html
Greg Ward0784c332000-04-28 17:03:26 +000057inst: inst/inst.html
58dist: dist/dist.html
Fred Drake07b12f21998-08-12 17:06:03 +000059
Fred Drakee15956b2000-04-03 04:51:13 +000060$(INDEXFILES): $(COMMONPERL) \
61 $(TOPDIR)/html/about.dat \
62 $(TOPDIR)/tools/node2label.pl
Fred Drake07b12f21998-08-12 17:06:03 +000063
Fred Drakef4070632000-08-11 17:36:21 +000064include ../Makefile.deps
65
Fred Drake664c72f1999-04-29 17:04:21 +000066# The index.html target is at the end since it screws up font-lock.
67
Fred Drake684f78f1999-02-24 17:34:12 +000068modindex.html: lib/lib.html mac/mac.html $(TOOLSDIR)/mkmodindex
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 Drakedbf7d991999-04-29 18:29:38 +000073api/api.html: $(PAPERDIR)/api.aux $(BUILDINDEX) $(TOOLSDIR)/mkhtml.sh
Fred Drakeb8aa2612000-07-31 15:55:22 +000074 $(MKHTML) api $(L2HARGS) -split 5
Fred Drake07b12f21998-08-12 17:06:03 +000075
Fred Drake1468d771999-03-18 19:07:04 +000076doc/doc.html: $(DOCFILES) $(BUILDINDEX) $(TOPDIR)/perl/ltxmarkup.perl
Fred Drake8903be61999-09-23 16:54:06 +000077 $(TOOLSDIR)/mkhowto --about stdabout.dat --address $(PYTHONDOCS) \
78 --html $(TOPDIR)/doc/doc.tex
Fred Drake1468d771999-03-18 19:07:04 +000079
Fred Drakedbf7d991999-04-29 18:29:38 +000080ext/ext.html: $(PAPERDIR)/ext.aux $(TOOLSDIR)/mkhtml.sh
Fred Drakeb8aa2612000-07-31 15:55:22 +000081 $(MKHTML) ext $(L2HARGS) -split 5
Fred Drake07b12f21998-08-12 17:06:03 +000082
Fred Drakedbf7d991999-04-29 18:29:38 +000083lib/lib.html: $(PAPERDIR)/lib.aux $(BUILDINDEX) $(TOOLSDIR)/mkhtml.sh
Fred Drake07b12f21998-08-12 17:06:03 +000084 $(TOOLSDIR)/fix_libaux.sed <`$(KPSEWHICH) lib.aux` >lib1.aux
85 mv lib1.aux `$(KPSEWHICH) lib.aux`
Fred Drakeb8aa2612000-07-31 15:55:22 +000086 $(MKHTML) lib $(L2HARGS) -split 5
Fred Drake07b12f21998-08-12 17:06:03 +000087
Fred Drake5d56d361999-01-05 15:49:39 +000088mac/mac.html: $(MACFILES) $(BUILDINDEX)
Fred Drake8903be61999-09-23 16:54:06 +000089 $(TOOLSDIR)/mkhowto --about stdabout.dat --address $(PYTHONDOCS) \
90 --html $(TOPDIR)/mac/mac.tex
Fred Drake07b12f21998-08-12 17:06:03 +000091
Fred Drakedbf7d991999-04-29 18:29:38 +000092ref/ref.html: $(PAPERDIR)/ref.aux $(BUILDINDEX) $(TOOLSDIR)/mkhtml.sh
Fred Drakeb8aa2612000-07-31 15:55:22 +000093 $(MKHTML) ref $(L2HARGS) -split 5
Fred Drake07b12f21998-08-12 17:06:03 +000094
Fred Drakedbf7d991999-04-29 18:29:38 +000095tut/tut.html: $(PAPERDIR)/tut.aux $(TOOLSDIR)/mkhtml.sh
96 $(MKHTML) --numeric tut $(L2HARGS) -split 3
Fred Drakef832f4c1998-08-11 19:36:35 +000097
Greg Ward0784c332000-04-28 17:03:26 +000098inst/inst.html:$(INSTFILES) $(TOPDIR)/perl/distutils.perl
99 $(TOOLSDIR)/mkhowto --about stdabout.dat --address $(PYTHONDOCS) \
100 --html $(TOPDIR)/inst/inst.tex
101
102dist/dist.html:$(DISTFILES) $(TOPDIR)/perl/distutils.perl
103 $(TOOLSDIR)/mkhowto --about stdabout.dat --address $(PYTHONDOCS) \
104 --html $(TOPDIR)/dist/dist.tex
Fred Drake60515f41998-05-07 14:50:22 +0000105
Fred Drake07b12f21998-08-12 17:06:03 +0000106$(PAPERDIR)/api.aux: $(APIFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +0000107 (cd $(PAPERDIR); $(MKAUX) api)
Fred Drake60515f41998-05-07 14:50:22 +0000108
Fred Drake07b12f21998-08-12 17:06:03 +0000109$(PAPERDIR)/ext.aux: $(EXTFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +0000110 (cd $(PAPERDIR); $(MKAUX) ext)
Fred Drake60515f41998-05-07 14:50:22 +0000111
Fred Drake07b12f21998-08-12 17:06:03 +0000112$(PAPERDIR)/lib.aux: $(LIBFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +0000113 (cd $(PAPERDIR); $(MKAUX) lib)
Fred Drake60515f41998-05-07 14:50:22 +0000114
Fred Drake07b12f21998-08-12 17:06:03 +0000115$(PAPERDIR)/ref.aux: $(REFFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +0000116 (cd $(PAPERDIR); $(MKAUX) ref)
Fred Drake60515f41998-05-07 14:50:22 +0000117
Fred Drake07b12f21998-08-12 17:06:03 +0000118$(PAPERDIR)/tut.aux: $(TUTFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +0000119 (cd $(PAPERDIR); $(MKAUX) tut)
Fred Drake60515f41998-05-07 14:50:22 +0000120
Fred Drake07b12f21998-08-12 17:06:03 +0000121
Fred Drake4d33e4e1999-02-15 19:29:08 +0000122webcheck: all
123 $(WEBCHECKER) $(HTMLBASE)/api/
Fred Drake1468d771999-03-18 19:07:04 +0000124 $(WEBCHECKER) $(HTMLBASE)/doc/
Fred Drake4d33e4e1999-02-15 19:29:08 +0000125 $(WEBCHECKER) $(HTMLBASE)/ext/
126 $(WEBCHECKER) -m290000 $(HTMLBASE)/lib/
127 $(WEBCHECKER) $(HTMLBASE)/mac/
128 $(WEBCHECKER) $(HTMLBASE)/ref/
129 $(WEBCHECKER) $(HTMLBASE)/tut/
Greg Ward0784c332000-04-28 17:03:26 +0000130 $(WEBCHECKER) $(HTMLBASE)/dist/
131 $(WEBCHECKER) $(HTMLBASE)/inst/
Fred Drake07b12f21998-08-12 17:06:03 +0000132
Fred Drake50c507e1999-04-29 19:04:55 +0000133wcnew: all
134 $(WCNEW) $(HTMLBASE)/api/
135 $(WCNEW) $(HTMLBASE)/doc/
136 $(WCNEW) $(HTMLBASE)/ext/
137 $(WCNEW) -m290000 $(HTMLBASE)/lib/
138 $(WCNEW) $(HTMLBASE)/mac/
139 $(WCNEW) $(HTMLBASE)/ref/
140 $(WCNEW) $(HTMLBASE)/tut/
141
142
Fred Drake07b12f21998-08-12 17:06:03 +0000143clean:
Fred Drake6f9dd5d1999-02-15 21:43:55 +0000144 rm -rf @webchecker.pickle
Fred Drake07b12f21998-08-12 17:06:03 +0000145
Fred Drake532998e1999-09-24 13:51:19 +0000146distclean realclean clobber: clean
Greg Ward0784c332000-04-28 17:03:26 +0000147 rm -rf index.html modindex.html
148 rm -rf api/ doc/ ext/ lib/ mac/ ref/ tut/ inst/ dist/
Fred Drake664c72f1999-04-29 17:04:21 +0000149
150
151# This is really ugly, but we're not dependent on $(RELEASE), which isn't
152# defined here. It also maintains the proper dependency on boilerplate.tex.
153
154# It's at the end of the file since it wedges font-lock in XEmacs.
155
156BOILERPLATE=$(TOPDIR)/texinputs/boilerplate.tex
157index.html: index.html.in $(BOILERPLATE)
Fred Drake0d6bf0e1999-11-18 20:56:29 +0000158 REL=`grep '\\release{' $(BOILERPLATE) | sed 's/.*\\release{\(.*\)}.*$$/\1/'`; \
159 REL=`echo "$$REL" | sed 's/[$$]//g'`; \
Fred Drake664c72f1999-04-29 17:04:21 +0000160 sed "s/@RELEASE@/$$REL/g" $< >TEMP
161 DATE=`grep '\\date{' $(BOILERPLATE) | sed 's/.*\\date{\(.*\)}.*$$/\1/'` ; \
Fred Drake0d6bf0e1999-11-18 20:56:29 +0000162 if [ "$$DATE" = '\today' ] ; then DATE=`date '+%B %e, %Y'`;fi;\
Fred Drake664c72f1999-04-29 17:04:21 +0000163 sed "s/@DATE@/$$DATE/g" TEMP >$@
164 rm -f TEMP
165