blob: aa61088f1cdf0d8fc5eea0e63f98a526fa653391 [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 \
37 tut/tut.html
38
39COMMONPERL= $(TOPDIR)/perl/manual.perl \
Fred Drake54c52051998-08-13 19:03:19 +000040 $(TOPDIR)/perl/python.perl \
41 $(TOPDIR)/perl/l2hinit.perl
Fred Drakef832f4c1998-08-11 19:36:35 +000042
43
Fred Drake5cc0a9b1999-04-29 15:42:19 +000044all: $(INDEXFILES) index.html modindex.html
Fred Drake07b12f21998-08-12 17:06:03 +000045
46.PHONY: api ext lib mac ref tut
47
Fred Drake6f9dd5d1999-02-15 21:43:55 +000048api: api/api.html
Fred Drake766e0cb1999-04-05 19:28:29 +000049doc: doc/doc.html
Fred Drake6f9dd5d1999-02-15 21:43:55 +000050ext: ext/ext.html
51lib: lib/lib.html
52mac: mac/mac.html
53ref: ref/ref.html
54tut: tut/tut.html
Fred Drake07b12f21998-08-12 17:06:03 +000055
Fred Drakee15956b2000-04-03 04:51:13 +000056$(INDEXFILES): $(COMMONPERL) \
57 $(TOPDIR)/html/about.dat \
58 $(TOPDIR)/tools/node2label.pl
Fred Drake07b12f21998-08-12 17:06:03 +000059
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 Drakedbf7d991999-04-29 18:29:38 +000067api/api.html: $(PAPERDIR)/api.aux $(BUILDINDEX) $(TOOLSDIR)/mkhtml.sh
Fred Drake07b12f21998-08-12 17:06:03 +000068 $(MKHTML) api $(L2HARGS)
69
Fred Drake1468d771999-03-18 19:07:04 +000070doc/doc.html: $(DOCFILES) $(BUILDINDEX) $(TOPDIR)/perl/ltxmarkup.perl
Fred Drake8903be61999-09-23 16:54:06 +000071 $(TOOLSDIR)/mkhowto --about stdabout.dat --address $(PYTHONDOCS) \
72 --html $(TOPDIR)/doc/doc.tex
Fred Drake1468d771999-03-18 19:07:04 +000073
Fred Drakedbf7d991999-04-29 18:29:38 +000074ext/ext.html: $(PAPERDIR)/ext.aux $(TOOLSDIR)/mkhtml.sh
Fred Drake07b12f21998-08-12 17:06:03 +000075 $(MKHTML) ext $(L2HARGS)
76
Fred Drakedbf7d991999-04-29 18:29:38 +000077lib/lib.html: $(PAPERDIR)/lib.aux $(BUILDINDEX) $(TOOLSDIR)/mkhtml.sh
Fred Drake07b12f21998-08-12 17:06:03 +000078 $(TOOLSDIR)/fix_libaux.sed <`$(KPSEWHICH) lib.aux` >lib1.aux
79 mv lib1.aux `$(KPSEWHICH) lib.aux`
80 $(MKHTML) lib $(L2HARGS)
81
Fred Drake5d56d361999-01-05 15:49:39 +000082mac/mac.html: $(MACFILES) $(BUILDINDEX)
Fred Drake8903be61999-09-23 16:54:06 +000083 $(TOOLSDIR)/mkhowto --about stdabout.dat --address $(PYTHONDOCS) \
84 --html $(TOPDIR)/mac/mac.tex
Fred Drake07b12f21998-08-12 17:06:03 +000085
Fred Drakedbf7d991999-04-29 18:29:38 +000086ref/ref.html: $(PAPERDIR)/ref.aux $(BUILDINDEX) $(TOOLSDIR)/mkhtml.sh
Fred Drake07b12f21998-08-12 17:06:03 +000087 $(MKHTML) ref $(L2HARGS)
88
Fred Drakedbf7d991999-04-29 18:29:38 +000089tut/tut.html: $(PAPERDIR)/tut.aux $(TOOLSDIR)/mkhtml.sh
90 $(MKHTML) --numeric tut $(L2HARGS) -split 3
Fred Drakef832f4c1998-08-11 19:36:35 +000091
Fred Drake60515f41998-05-07 14:50:22 +000092
Fred Drake2e23c311998-10-07 22:03:45 +000093include ../Makefile.deps
94
Fred Drake07b12f21998-08-12 17:06:03 +000095$(PAPERDIR)/api.aux: $(APIFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +000096 (cd $(PAPERDIR); $(MKAUX) api)
Fred Drake60515f41998-05-07 14:50:22 +000097
Fred Drake07b12f21998-08-12 17:06:03 +000098$(PAPERDIR)/ext.aux: $(EXTFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +000099 (cd $(PAPERDIR); $(MKAUX) ext)
Fred Drake60515f41998-05-07 14:50:22 +0000100
Fred Drake07b12f21998-08-12 17:06:03 +0000101$(PAPERDIR)/lib.aux: $(LIBFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +0000102 (cd $(PAPERDIR); $(MKAUX) lib)
Fred Drake60515f41998-05-07 14:50:22 +0000103
Fred Drake07b12f21998-08-12 17:06:03 +0000104$(PAPERDIR)/ref.aux: $(REFFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +0000105 (cd $(PAPERDIR); $(MKAUX) ref)
Fred Drake60515f41998-05-07 14:50:22 +0000106
Fred Drake07b12f21998-08-12 17:06:03 +0000107$(PAPERDIR)/tut.aux: $(TUTFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +0000108 (cd $(PAPERDIR); $(MKAUX) tut)
Fred Drake60515f41998-05-07 14:50:22 +0000109
Fred Drake07b12f21998-08-12 17:06:03 +0000110
Fred Drake4d33e4e1999-02-15 19:29:08 +0000111webcheck: all
112 $(WEBCHECKER) $(HTMLBASE)/api/
Fred Drake1468d771999-03-18 19:07:04 +0000113 $(WEBCHECKER) $(HTMLBASE)/doc/
Fred Drake4d33e4e1999-02-15 19:29:08 +0000114 $(WEBCHECKER) $(HTMLBASE)/ext/
115 $(WEBCHECKER) -m290000 $(HTMLBASE)/lib/
116 $(WEBCHECKER) $(HTMLBASE)/mac/
117 $(WEBCHECKER) $(HTMLBASE)/ref/
118 $(WEBCHECKER) $(HTMLBASE)/tut/
Fred Drake07b12f21998-08-12 17:06:03 +0000119
Fred Drake50c507e1999-04-29 19:04:55 +0000120wcnew: all
121 $(WCNEW) $(HTMLBASE)/api/
122 $(WCNEW) $(HTMLBASE)/doc/
123 $(WCNEW) $(HTMLBASE)/ext/
124 $(WCNEW) -m290000 $(HTMLBASE)/lib/
125 $(WCNEW) $(HTMLBASE)/mac/
126 $(WCNEW) $(HTMLBASE)/ref/
127 $(WCNEW) $(HTMLBASE)/tut/
128
129
Fred Drake07b12f21998-08-12 17:06:03 +0000130clean:
Fred Drake6f9dd5d1999-02-15 21:43:55 +0000131 rm -rf @webchecker.pickle
Fred Drake07b12f21998-08-12 17:06:03 +0000132
Fred Drake532998e1999-09-24 13:51:19 +0000133distclean realclean clobber: clean
134 rm -rf index.html modindex.html api/ doc/ ext/ lib/ mac/ ref/ tut/
Fred Drake664c72f1999-04-29 17:04:21 +0000135
136
137# This is really ugly, but we're not dependent on $(RELEASE), which isn't
138# defined here. It also maintains the proper dependency on boilerplate.tex.
139
140# It's at the end of the file since it wedges font-lock in XEmacs.
141
142BOILERPLATE=$(TOPDIR)/texinputs/boilerplate.tex
143index.html: index.html.in $(BOILERPLATE)
Fred Drake0d6bf0e1999-11-18 20:56:29 +0000144 REL=`grep '\\release{' $(BOILERPLATE) | sed 's/.*\\release{\(.*\)}.*$$/\1/'`; \
145 REL=`echo "$$REL" | sed 's/[$$]//g'`; \
Fred Drake664c72f1999-04-29 17:04:21 +0000146 sed "s/@RELEASE@/$$REL/g" $< >TEMP
147 DATE=`grep '\\date{' $(BOILERPLATE) | sed 's/.*\\date{\(.*\)}.*$$/\1/'` ; \
Fred Drake0d6bf0e1999-11-18 20:56:29 +0000148 if [ "$$DATE" = '\today' ] ; then DATE=`date '+%B %e, %Y'`;fi;\
Fred Drake664c72f1999-04-29 17:04:21 +0000149 sed "s/@DATE@/$$DATE/g" TEMP >$@
150 rm -f TEMP
151