source: trunk/packages/xen-common/xen-common/docs/Makefile @ 95

Last change on this file since 95 was 34, checked in by hartmans, 17 years ago

Add xen and xen-common

  • Property svn:mime-type set to text/script
File size: 3.0 KB
Line 
1#!/usr/bin/make -f
2
3XEN_ROOT=..
4include $(XEN_ROOT)/Config.mk
5include $(XEN_ROOT)/docs/Docs.mk
6
7VERSION         = xen-unstable
8
9DOC_MAN5SRC     := $(wildcard man/*.pod.5)
10DOC_MAN1SRC     := $(wildcard man/*.pod.1)
11DOC_MAN1        := $(patsubst man/%.pod.1,man1/%.1,$(DOC_MAN1SRC))
12DOC_MAN5        := $(patsubst man/%.pod.5,man5/%.5,$(DOC_MAN5SRC))
13DOC_TEX         := src/user.tex src/interface.tex
14DOC_PS          := $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
15DOC_PDF         := $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
16DOC_HTML        := $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX))
17
18GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
19
20.PHONY: all
21all: build
22
23.PHONY: build
24build: ps pdf html man-pages
25        @if which $(DOT) 1>/dev/null 2>/dev/null ; then              \
26        $(MAKE) -C xen-api build ; else                              \
27        echo "Graphviz (dot) not installed; skipping xen-api." ; fi
28        rm -f *.aux *.dvi *.bbl *.blg *.glo *.idx *.ilg *.log *.ind *.toc
29
30.PHONY: dev-docs
31dev-docs: python-dev-docs
32
33.PHONY: ps
34ps: $(DOC_PS)
35
36.PHONY: pdf
37pdf: $(DOC_PDF)
38
39.PHONY: html
40html:
41        @if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
42        $(MAKE) $(DOC_HTML); fi
43
44.PHONY: python-dev-docs
45python-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
52
53.PHONY: man-pages
54man-pages:
55        @if which $(POD2MAN) 1>/dev/null 2>/dev/null; then \
56        $(MAKE) $(DOC_MAN1) $(DOC_MAN5); fi
57
58man1/%.1: man/%.pod.1 Makefile
59        $(INSTALL_DIR) $(@D)
60        $(POD2MAN) --release=$(VERSION) --name=`echo $@ | sed 's/^man1.//'| \
61                sed 's/.1//'` -s 1 -c "Xen" $< $@
62
63man5/%.5: man/%.pod.5 Makefile
64        $(INSTALL_DIR) $(@D)
65        $(POD2MAN) --release=$(VERSION) --name=`echo $@ | sed 's/^man5.//'| \
66                sed 's/.5//'` -s 5 -c "Xen" $< $@
67
68.PHONY: clean
69clean:
70        $(MAKE) -C xen-api clean
71        rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~
72        rm -rf *.ilg *.log *.ind *.toc *.bak core
73        rm -rf $(GFX) ps pdf html
74        rm -rf api
75        rm -rf man5
76        rm -rf man1
77
78.PHONY: distclean
79distclean: clean
80
81.PHONY: install
82install: all
83        rm -rf $(DESTDIR)$(pkgdocdir)
84        $(INSTALL_DIR) $(DESTDIR)$(pkgdocdir)
85
86        $(MAKE) -C xen-api install
87
88        cp -dR ps $(DESTDIR)$(pkgdocdir)
89        cp -dR pdf $(DESTDIR)$(pkgdocdir)
90        $(INSTALL_DIR) $(DESTDIR)$(mandir)
91        cp -dR man1 $(DESTDIR)$(mandir)
92        cp -dR man5 $(DESTDIR)$(mandir)
93        [ ! -d html ] || cp -dR html $(DESTDIR)$(pkgdocdir)
94
95pdf/%.pdf: ps/%.ps
96        $(INSTALL_DIR) $(@D)
97        $(PS2PDF) $< $@.new
98        mv $@.new $@
99
100ps/%.ps: %.dvi
101        $(INSTALL_DIR) $(@D)
102        $(DVIPS) -Ppdf -G0 -o $@.new $<
103        mv $@.new $@
104
105%.dvi: src/%.tex $(GFX)
106        $(LATEX) $< >/dev/null
107        if [ -e $*.toc ] ; then $(LATEX) $< >/dev/null ; fi
108
109%.eps: %.fig
110        $(FIG2DEV) -L eps $< $@
111
112html/%/index.html: src/%.tex
113        $(INSTALL_DIR) $(@D)
114        $(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
115        -numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
116        $< 1>/dev/null 2>/dev/null
Note: See TracBrowser for help on using the repository browser.