ia64/xen-unstable

view docs/Makefile @ 9660:b454a09cddb1

build: Clean up use of .PHONY

* Move .PHONY directives next to targets,
this makes them a lot harder to miss
* Add missing .PHONY directives
* Remove nonexistent .PHONY directives
* Hopefully I didn'T miss anything...

Signed-Off-By: Horms <horms@verge.net.au>
author kaf24@firebug.cl.cam.ac.uk
date Mon Apr 10 17:02:49 2006 +0100 (2006-04-10)
parents d49fd494963e
children 7154e0416313
line source
1 #!/usr/bin/make -f
3 VERSION = xen-unstable
4 INSTALL = install
5 INSTALL_DIR = $(INSTALL) -d -m0755
7 PS2PDF := ps2pdf
8 DVIPS := dvips
9 LATEX := latex
10 FIG2DEV := fig2dev
11 LATEX2HTML := latex2html
12 DOXYGEN := doxygen
13 POD2MAN := pod2man
15 pkgdocdir := /usr/share/doc/xen
16 mandir := /usr/share/man
18 DOC_MAN5SRC := $(wildcard man/*.pod.5)
19 DOC_MAN1SRC := $(wildcard man/*.pod.1)
20 DOC_MAN1 := $(patsubst man/%.pod.1,man1/%.1,$(DOC_MAN1SRC))
21 DOC_MAN5 := $(patsubst man/%.pod.5,man5/%.5,$(DOC_MAN5SRC))
22 DOC_TEX := src/user.tex src/interface.tex
23 DOC_PS := $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
24 DOC_PDF := $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
25 DOC_HTML := $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX))
27 GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
29 .PHONY: all
30 all: build
32 .PHONY: build
33 build: ps pdf html man-pages
34 rm -f *.aux *.dvi *.bbl *.blg *.glo *.idx *.ilg *.log *.ind *.toc
36 .PHONY: dev-docs
37 dev-docs: python-dev-docs
39 .PHONY: ps
40 ps: $(DOC_PS)
42 .PHONY: pdf
43 pdf: $(DOC_PDF)
45 .PHONY: html
46 html:
47 @if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
48 $(MAKE) $(DOC_HTML); fi
50 .PHONY: python-dev-docs
51 python-dev-docs:
52 @mkdir -v -p api/tools/python
53 @if which $(DOXYGEN) 1>/dev/null 2>/dev/null; then \
54 echo "Running doxygen to generate Python tools APIs ... "; \
55 $(DOXYGEN) Doxyfile; \
56 $(MAKE) -C api/tools/python/latex ; else \
57 echo "Doxygen not installed; skipping python-dev-docs."; fi
59 .PHONY: man-pages
60 man-pages:
61 @if which $(POD2MAN) 1>/dev/null 2>/dev/null; then \
62 $(MAKE) $(DOC_MAN1) $(DOC_MAN5); fi
64 man1/%.1: man/%.pod.1 Makefile
65 $(INSTALL_DIR) $(@D)
66 $(POD2MAN) --release=$(VERSION) --name=`echo $@ | sed 's/^man1.//'| \
67 sed 's/.1//'` -s 1 -c "Xen" $< $@
69 man5/%.5: man/%.pod.5 Makefile
70 $(INSTALL_DIR) $(@D)
71 $(POD2MAN) --release=$(VERSION) --name=`echo $@ | sed 's/^man5.//'| \
72 sed 's/.5//'` -s 5 -c "Xen" $< $@
74 .PHONY: clean
75 clean:
76 rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~
77 rm -rf *.ilg *.log *.ind *.toc *.bak core
78 rm -rf $(GFX) ps pdf html
79 rm -rf api
80 rm -rf man5
81 rm -rf man1
83 .PHONY: install
84 install: all
85 rm -rf $(DESTDIR)$(pkgdocdir)
86 $(INSTALL_DIR) $(DESTDIR)$(pkgdocdir)
87 cp -dR ps $(DESTDIR)$(pkgdocdir)
88 cp -dR pdf $(DESTDIR)$(pkgdocdir)
89 $(INSTALL_DIR) $(DESTDIR)$(mandir)
90 cp -dR man1 $(DESTDIR)$(mandir)
91 cp -dR man5 $(DESTDIR)$(mandir)
92 [ ! -d html ] || cp -dR html $(DESTDIR)$(pkgdocdir)
94 pdf/%.pdf: ps/%.ps
95 $(INSTALL_DIR) $(@D)
96 $(PS2PDF) $< $@.new
97 mv $@.new $@
99 ps/%.ps: %.dvi
100 $(INSTALL_DIR) $(@D)
101 $(DVIPS) -Ppdf -G0 -o $@.new $<
102 mv $@.new $@
104 %.dvi: src/%.tex $(GFX)
105 $(LATEX) $< >/dev/null
106 if [ -e $*.toc ] ; then $(LATEX) $< >/dev/null ; fi
108 %.eps: %.fig
109 $(FIG2DEV) -L eps $< $@
111 html/%/index.html: src/%.tex
112 $(INSTALL_DIR) $(@D)
113 $(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
114 -numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
115 $< 1>/dev/null 2>/dev/null