ia64/xen-unstable

view docs/Makefile @ 7576:d49fd494963e

--- xen-unstable.hg.copy/docs/Makefile 2005-10-28 18:36:33.000000000 -0700
+++ xen-unstable.hg/docs/Makefile 2005-10-28 14:58:18.000000000 -0700
@@ -1,5 +1,6 @@
#!/usr/bin/make -f

+VERSION = xen-unstable
INSTALL = install
INSTALL_DIR = $(INSTALL) -d -m0755

@@ -9,9 +10,15 @@
FIG2DEV := fig2dev
LATEX2HTML := latex2html
DOXYGEN := doxygen
+POD2MAN := pod2man

pkgdocdir := /usr/share/doc/xen
+mandir := /usr/share/man

+DOC_MAN5SRC := $(wildcard man/*.pod.5)
+DOC_MAN1SRC := $(wildcard man/*.pod.1)
+DOC_MAN1 := $(patsubst man/%.pod.1,man1/%.1,$(DOC_MAN1SRC))
+DOC_MAN5 := $(patsubst man/%.pod.5,man5/%.5,$(DOC_MAN5SRC))
DOC_TEX := src/user.tex src/interface.tex
DOC_PS := $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
DOC_PDF := $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
@@ -22,7 +29,7 @@
.PHONY: all build dev-docs python-dev-docs ps pdf html clean install

all: build
-build: ps pdf html
+build: ps pdf html man-pages
rm -f *.aux *.dvi *.bbl *.blg *.glo *.idx *.ilg *.log *.ind *.toc

dev-docs: python-dev-docs
@@ -43,17 +50,36 @@
$(MAKE) -C api/tools/python/latex ; else \
echo "Doxygen not installed; skipping python-dev-docs."; fi

+man-pages:
+ @if which $(POD2MAN) 1>/dev/null 2>/dev/null; then \
+ $(MAKE) $(DOC_MAN1) $(DOC_MAN5); fi
+
+man1/%.1: man/%.pod.1 Makefile
+ $(INSTALL_DIR) $(@D)
+ $(POD2MAN) --release=$(VERSION) --name=`echo $@ | sed 's/^man1.//'| \
+ sed 's/.1//'` -s 1 -c "Xen" $< $@
+
+man5/%.5: man/%.pod.5 Makefile
+ $(INSTALL_DIR) $(@D)
+ $(POD2MAN) --release=$(VERSION) --name=`echo $@ | sed 's/^man5.//'| \
+ sed 's/.5//'` -s 5 -c "Xen" $< $@
+
clean:
rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~
rm -rf *.ilg *.log *.ind *.toc *.bak core
rm -rf $(GFX) ps pdf html
rm -rf api
+ rm -rf man5
+ rm -rf man1

install: all
rm -rf $(DESTDIR)$(pkgdocdir)
$(INSTALL_DIR) $(DESTDIR)$(pkgdocdir)
cp -dR ps $(DESTDIR)$(pkgdocdir)
cp -dR pdf $(DESTDIR)$(pkgdocdir)
+ $(INSTALL_DIR) $(DESTDIR)$(mandir)
+ cp -dR man1 $(DESTDIR)$(mandir)
+ cp -dR man5 $(DESTDIR)$(mandir)
[ ! -d html ] || cp -dR html $(DESTDIR)$(pkgdocdir)

pdf/%.pdf: ps/%.ps
author emellor@leeni.uk.xensource.com
date Sun Oct 30 17:20:09 2005 +0100 (2005-10-30)
parents 06d84bf87159
children b454a09cddb1
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 build dev-docs python-dev-docs ps pdf html clean install
31 all: build
32 build: ps pdf html man-pages
33 rm -f *.aux *.dvi *.bbl *.blg *.glo *.idx *.ilg *.log *.ind *.toc
35 dev-docs: python-dev-docs
37 ps: $(DOC_PS)
39 pdf: $(DOC_PDF)
41 html:
42 @if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
43 $(MAKE) $(DOC_HTML); fi
45 python-dev-docs:
46 @mkdir -v -p api/tools/python
47 @if which $(DOXYGEN) 1>/dev/null 2>/dev/null; then \
48 echo "Running doxygen to generate Python tools APIs ... "; \
49 $(DOXYGEN) Doxyfile; \
50 $(MAKE) -C api/tools/python/latex ; else \
51 echo "Doxygen not installed; skipping python-dev-docs."; fi
53 man-pages:
54 @if which $(POD2MAN) 1>/dev/null 2>/dev/null; then \
55 $(MAKE) $(DOC_MAN1) $(DOC_MAN5); fi
57 man1/%.1: man/%.pod.1 Makefile
58 $(INSTALL_DIR) $(@D)
59 $(POD2MAN) --release=$(VERSION) --name=`echo $@ | sed 's/^man1.//'| \
60 sed 's/.1//'` -s 1 -c "Xen" $< $@
62 man5/%.5: man/%.pod.5 Makefile
63 $(INSTALL_DIR) $(@D)
64 $(POD2MAN) --release=$(VERSION) --name=`echo $@ | sed 's/^man5.//'| \
65 sed 's/.5//'` -s 5 -c "Xen" $< $@
67 clean:
68 rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~
69 rm -rf *.ilg *.log *.ind *.toc *.bak core
70 rm -rf $(GFX) ps pdf html
71 rm -rf api
72 rm -rf man5
73 rm -rf man1
75 install: all
76 rm -rf $(DESTDIR)$(pkgdocdir)
77 $(INSTALL_DIR) $(DESTDIR)$(pkgdocdir)
78 cp -dR ps $(DESTDIR)$(pkgdocdir)
79 cp -dR pdf $(DESTDIR)$(pkgdocdir)
80 $(INSTALL_DIR) $(DESTDIR)$(mandir)
81 cp -dR man1 $(DESTDIR)$(mandir)
82 cp -dR man5 $(DESTDIR)$(mandir)
83 [ ! -d html ] || cp -dR html $(DESTDIR)$(pkgdocdir)
85 pdf/%.pdf: ps/%.ps
86 $(INSTALL_DIR) $(@D)
87 $(PS2PDF) $< $@.new
88 mv $@.new $@
90 ps/%.ps: %.dvi
91 $(INSTALL_DIR) $(@D)
92 $(DVIPS) -Ppdf -G0 -o $@.new $<
93 mv $@.new $@
95 %.dvi: src/%.tex $(GFX)
96 $(LATEX) $< >/dev/null
97 if [ -e $*.toc ] ; then $(LATEX) $< >/dev/null ; fi
99 %.eps: %.fig
100 $(FIG2DEV) -L eps $< $@
102 html/%/index.html: src/%.tex
103 $(INSTALL_DIR) $(@D)
104 $(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
105 -numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
106 $< 1>/dev/null 2>/dev/null