ia64/xen-unstable

view docs/Makefile @ 4107:fcd17066e110

bitkeeper revision 1.1159.270.1 (423308766_Mxiqyj1XF-m4OxnLnExA)

No longer require latex2html (bizarrely considered 'non-free' by Debian
maintainers) to build docs. Instead we still build PS/PDF docs, but skip
HTML docs.
Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
author kaf24@viper.(none)
date Sat Mar 12 15:19:18 2005 +0000 (2005-03-12)
parents 9340287b7f30
children 3ee85723a341
line source
1 #!/usr/bin/make -f
3 INSTALL = install
4 INSTALL_DIR = $(INSTALL) -d -m0755
6 PS2PDF := ps2pdf
7 DVIPS := dvips
8 LATEX := latex
9 FIG2DEV := fig2dev
10 LATEX2HTML := latex2html
12 pkgdocdir := /usr/share/doc/xen
14 DOC_TEX := $(wildcard src/*.tex)
15 DOC_PS := $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
16 DOC_PDF := $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
17 DOC_HTML := $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX))
19 GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
21 all: ps pdf html
22 rm -f *.aux *.dvi *.bbl *.blg *.glo *.idx *.ilg *.log *.ind *.toc
24 ps: $(DOC_PS)
26 pdf: $(DOC_PDF)
28 html:
29 @if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
30 $(MAKE) $(DOC_HTML); fi
32 clean:
33 rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~
34 rm -rf *.ilg *.log *.ind *.toc *.bak core
35 rm -rf $(GFX) ps pdf html
37 install: all
38 rm -rf $(DESTDIR)$(pkgdocdir)
39 $(INSTALL_DIR) $(DESTDIR)$(pkgdocdir)
40 cp -dR ps $(DESTDIR)$(pkgdocdir)
41 cp -dR pdf $(DESTDIR)$(pkgdocdir)
42 [ ! -d html ] || cp -dR html $(DESTDIR)$(pkgdocdir)
44 pdf/%.pdf: ps/%.ps
45 $(INSTALL_DIR) $(@D)
46 $(PS2PDF) $< $@.new
47 mv $@.new $@
49 ps/%.ps: %.dvi
50 $(INSTALL_DIR) $(@D)
51 $(DVIPS) -Ppdf -G0 -o $@.new $<
52 mv $@.new $@
54 %.dvi: src/%.tex $(GFX)
55 $(LATEX) $< >/dev/null
56 if [ -e $*.toc ] ; then $(LATEX) $< >/dev/null ; fi
58 %.eps: %.fig
59 $(FIG2DEV) -L eps $< $@
61 html/%/index.html: src/%.tex
62 $(INSTALL_DIR) $(@D)
63 $(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
64 -numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
65 $< 1>/dev/null 2>/dev/null