ia64/xen-unstable

view docs/Makefile @ 6785:89a842453d77

Added dev-docs target to build the Python Tools' API documentation.
author ewan@linford.intra
date Sun Sep 11 21:12:40 2005 +0100 (2005-09-11)
parents a01199a95070
children 4d899a738d59 e7c7196fa329
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
11 DOXYGEN := doxygen
13 pkgdocdir := /usr/share/doc/xen
15 DOC_TEX := $(wildcard src/*.tex)
16 DOC_PS := $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
17 DOC_PDF := $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
18 DOC_HTML := $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX))
20 GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
22 .PHONY: all build dev-docs python-dev-docs ps pdf html clean install
24 all: build
25 build: ps pdf html
26 rm -f *.aux *.dvi *.bbl *.blg *.glo *.idx *.ilg *.log *.ind *.toc
28 dev-docs: python-dev-docs
30 ps: $(DOC_PS)
32 pdf: $(DOC_PDF)
34 html:
35 @if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
36 $(MAKE) $(DOC_HTML); fi
38 python-dev-docs:
39 mkdir -p api/tools/python
40 @if which $(DOXYGEN) 1>/dev/null 2>/dev/null; then \
41 echo "Running doxygen to generate Python tools APIs ... "; \
42 $(DOXYGEN) Doxyfile; \
43 $(MAKE) -C api/tools/python/latex ; fi
45 clean:
46 rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~
47 rm -rf *.ilg *.log *.ind *.toc *.bak core
48 rm -rf $(GFX) ps pdf html
49 rm -rf api
51 install: all
52 rm -rf $(DESTDIR)$(pkgdocdir)
53 $(INSTALL_DIR) $(DESTDIR)$(pkgdocdir)
54 cp -dR ps $(DESTDIR)$(pkgdocdir)
55 cp -dR pdf $(DESTDIR)$(pkgdocdir)
56 [ ! -d html ] || cp -dR html $(DESTDIR)$(pkgdocdir)
58 pdf/%.pdf: ps/%.ps
59 $(INSTALL_DIR) $(@D)
60 $(PS2PDF) $< $@.new
61 mv $@.new $@
63 ps/%.ps: %.dvi
64 $(INSTALL_DIR) $(@D)
65 $(DVIPS) -Ppdf -G0 -o $@.new $<
66 mv $@.new $@
68 %.dvi: src/%.tex $(GFX)
69 $(LATEX) $< >/dev/null
70 if [ -e $*.toc ] ; then $(LATEX) $< >/dev/null ; fi
72 %.eps: %.fig
73 $(FIG2DEV) -L eps $< $@
75 html/%/index.html: src/%.tex
76 $(INSTALL_DIR) $(@D)
77 $(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
78 -numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
79 $< 1>/dev/null 2>/dev/null