blob: c8476f8a676bc67780af7bd90e7176309c712c02 [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
27HTMLBASE= file:`pwd`
Fred Drake5761b761999-02-12 21:42:23 +000028
Fred Drake07b12f21998-08-12 17:06:03 +000029INDEXFILES=api/api.html \
30 ext/ext.html \
31 lib/lib.html \
32 mac/mac.html \
33 ref/ref.html \
34 tut/tut.html
35
36COMMONPERL= $(TOPDIR)/perl/manual.perl \
Fred Drake54c52051998-08-13 19:03:19 +000037 $(TOPDIR)/perl/python.perl \
38 $(TOPDIR)/perl/l2hinit.perl
Fred Drakef832f4c1998-08-11 19:36:35 +000039
40
Fred Drake07b12f21998-08-12 17:06:03 +000041all: icons $(INDEXFILES)
42
43.PHONY: api ext lib mac ref tut
44
45api: icons api/api.html
46ext: icons ext/ext.html
47lib: icons lib/lib.html
48mac: icons mac/mac.html
49ref: icons ref/ref.html
50tut: icons tut/tut.html
51
Fred Drakea8ba3641998-11-30 20:28:35 +000052$(INDEXFILES): $(COMMONPERL) $(TOPDIR)/html/about.dat
Fred Drake07b12f21998-08-12 17:06:03 +000053
Fred Drake5d56d361999-01-05 15:49:39 +000054api/api.html: $(PAPERDIR)/api.aux $(BUILDINDEX)
Fred Drake07b12f21998-08-12 17:06:03 +000055 $(MKHTML) api $(L2HARGS)
56
57ext/ext.html: $(PAPERDIR)/ext.aux
58 $(MKHTML) ext $(L2HARGS)
59
Fred Drake5d56d361999-01-05 15:49:39 +000060lib/lib.html: $(PAPERDIR)/lib.aux $(BUILDINDEX)
Fred Drake07b12f21998-08-12 17:06:03 +000061 $(TOOLSDIR)/fix_libaux.sed <`$(KPSEWHICH) lib.aux` >lib1.aux
62 mv lib1.aux `$(KPSEWHICH) lib.aux`
63 $(MKHTML) lib $(L2HARGS)
64
Fred Drake5d56d361999-01-05 15:49:39 +000065mac/mac.html: $(MACFILES) $(BUILDINDEX)
Fred Drakea8ba3641998-11-30 20:28:35 +000066 $(TOOLSDIR)/mkhowto.sh --address '<hr>Send comments to <a href="mailto:python-docs@python.org">python-docs@python.org</a>.' --html $(TOPDIR)/mac/mac.tex
Fred Drake07b12f21998-08-12 17:06:03 +000067
Fred Drake5d56d361999-01-05 15:49:39 +000068ref/ref.html: $(PAPERDIR)/ref.aux $(BUILDINDEX)
Fred Drake07b12f21998-08-12 17:06:03 +000069 $(MKHTML) ref $(L2HARGS)
70
71tut/tut.html: $(PAPERDIR)/tut.aux
72 $(MKHTML) tut $(L2HARGS)
Fred Drakef832f4c1998-08-11 19:36:35 +000073
Fred Drake60515f41998-05-07 14:50:22 +000074
Fred Drake2e23c311998-10-07 22:03:45 +000075include ../Makefile.deps
76
Fred Drake07b12f21998-08-12 17:06:03 +000077$(PAPERDIR)/api.aux: $(APIFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +000078 (cd $(PAPERDIR); $(MKAUX) api)
Fred Drake60515f41998-05-07 14:50:22 +000079
Fred Drake07b12f21998-08-12 17:06:03 +000080$(PAPERDIR)/ext.aux: $(EXTFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +000081 (cd $(PAPERDIR); $(MKAUX) ext)
Fred Drake60515f41998-05-07 14:50:22 +000082
Fred Drake07b12f21998-08-12 17:06:03 +000083$(PAPERDIR)/lib.aux: $(LIBFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +000084 (cd $(PAPERDIR); $(MKAUX) lib)
Fred Drake60515f41998-05-07 14:50:22 +000085
Fred Drake07b12f21998-08-12 17:06:03 +000086$(PAPERDIR)/ref.aux: $(REFFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +000087 (cd $(PAPERDIR); $(MKAUX) ref)
Fred Drake60515f41998-05-07 14:50:22 +000088
Fred Drake07b12f21998-08-12 17:06:03 +000089$(PAPERDIR)/tut.aux: $(TUTFILES)
Fred Drake4d33e4e1999-02-15 19:29:08 +000090 (cd $(PAPERDIR); $(MKAUX) tut)
Fred Drake60515f41998-05-07 14:50:22 +000091
Fred Drake07b12f21998-08-12 17:06:03 +000092# copy the icons/ directory over...
Fred Drake60515f41998-05-07 14:50:22 +000093icons:
Fred Drake07b12f21998-08-12 17:06:03 +000094 mkdir icons/
Fred Drakef832f4c1998-08-11 19:36:35 +000095 cp $(TOPDIR)/icons/*.gif icons/
Fred Drake07b12f21998-08-12 17:06:03 +000096
97
Fred Drake4d33e4e1999-02-15 19:29:08 +000098webcheck: all
99 $(WEBCHECKER) $(HTMLBASE)/api/
100 $(WEBCHECKER) $(HTMLBASE)/ext/
101 $(WEBCHECKER) -m290000 $(HTMLBASE)/lib/
102 $(WEBCHECKER) $(HTMLBASE)/mac/
103 $(WEBCHECKER) $(HTMLBASE)/ref/
104 $(WEBCHECKER) $(HTMLBASE)/tut/
Fred Drake07b12f21998-08-12 17:06:03 +0000105
106clean:
107 rm -rf icons/ @webchecker.pickle
108
109clobber: clean
110 rm -rf api/ ext/ lib/ mac/ ref/ tut/