blob: c0a78e574d860c2893ab778853a72e320498474d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
# Process DocBook to HTML
DBPROC=xsltproc
DOCBOOK_DIR = docbook
HTML_DIR = htmlguide
MAN_DIR = man
BOOKXSL = $(DOCBOOK_DIR)/bb-book.xsl
NOCHUNKBOOKXSL = $(DOCBOOK_DIR)/bb-nochunk-book.xsl
MANXSL = $(DOCBOOK_DIR)/bb-man.xsl
VPATH = $(DOCBOOK_DIR)
.SUFFIXES: .html .xml .gz .1 .5 .8
all: docs
docs: instguide adminguide manpages
@mkdir -p $(HTML_DIR)/images
@cp $(DOCBOOK_DIR)/html/images/*.png $(HTML_DIR)/images/.
@cp $(DOCBOOK_DIR)/html/*.css $(HTML_DIR)/.
@cp $(DOCBOOK_DIR)/html/*.ico $(HTML_DIR)/.
adminguide: $(DOCBOOK_DIR)/ExceptionCodes.xml $(HTML_DIR)/adminguide/index.html
# all sources ($>) is exactly the right args for xsltproc
$(HTML_DIR)/adminguide/index.html: $(BOOKXSL) $(DOCBOOK_DIR)/adminguide.xml
$(DBPROC) -o $(HTML_DIR)/adminguide/ $>
instguide: $(HTML_DIR)/instguide/index.html
$(HTML_DIR)/instguide/index.html: $(BOOKXSL) $(DOCBOOK_DIR)/instguide.xml
$(DBPROC) -o $(HTML_DIR)/instguide/ $>
# $< is empty on BSD make when making this rule, $> has all sources
# $< has the target on GNU make, $> is empty
$(DOCBOOK_DIR)/ExceptionCodes.xml: ../ExceptionCodes.txt
perl tools/generate_except_xml.pl $< $> $@
manpages: $(MANXSL) man-dirs man-nroff man-html
$(MANXSL): $(MANXSL).tmpl
@if [ -f /usr/local/share/xsl/docbook/manpages/docbook.xsl ]; then \
DOCBOOK=file:///usr/local/share/xsl/docbook/manpages/docbook.xsl; \
elif [ -f /opt/local/share/xsl/docbook-xsl/manpages/docbook.xsl ]; then \
DOCBOOK=file:///opt/local/share/xsl/docbook-xsl/manpages/docbook.xsl; \
elif [ -f /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl ]; then \
DOCBOOK=file:///usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl; \
else \
DOCBOOK=http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl; \
fi; \
sed -e "s,%%DOCBOOK%%,$${DOCBOOK}," $(MANXSL).tmpl > $(MANXSL)
man-dirs: man/.there $(HTML_DIR)/man-html/.there
$(HTML_DIR)/man-html/.there:
mkdir -p $(HTML_DIR)/man-html
touch $(HTML_DIR)/man-html/.there
man/.there:
mkdir -p man
touch man/.there
NROFF_PAGES = bbackupd.8 bbackupd-config.8 bbackupctl.8 bbackupquery.8 \
bbstored.8 bbstored-config.8 bbstoreaccounts.8 bbstored-certs.8 \
raidfile-config.8 \
bbackupd.conf.5 bbstored.conf.5 raidfile.conf.5
NROFF_FILES = $(NROFF_PAGES:%=$(MAN_DIR)/%.gz)
man-nroff: $(NROFF_FILES)
HTML_FILES_1 = $(NROFF_PAGES:%.5=%.html)
HTML_FILES_2 = $(HTML_FILES_1:%.8=%.html)
HTML_FILES = $(HTML_FILES_2:%=$(HTML_DIR)/man-html/%)
man-html: $(HTML_FILES)
# GNU make
$(HTML_DIR)/man-html/%.html: $(DOCBOOK_DIR)/%.xml $(NOCHUNKBOOKXSL)
$(DBPROC) -o $@ $(NOCHUNKBOOKXSL) $<
# GNU make
$(MAN_DIR)/%.8.gz: $(DOCBOOK_DIR)/%.xml $(MANXSL)
$(DBPROC) -o $(@:.gz=) $(MANXSL) $<
gzip $(@:.gz=)
# GNU make
$(MAN_DIR)/%.5.gz: $(DOCBOOK_DIR)/%.xml $(MANXSL)
$(DBPROC) -o $(@:.gz=) $(MANXSL) $<
gzip $(@:.gz=)
# BSD make: the final colon (:) is required to make this line valid syntax
# for a dummy rule in GNU make. It creates a dummy rule in BSD make too.
# Both dummy rules are harmless.
.for MAN_PAGE in $(NROFF_PAGES) :
$(MAN_DIR)/$(MAN_PAGE).gz: $(DOCBOOK_DIR)/$(MAN_PAGE:R).xml
$(DBPROC) -o $(.TARGET:.gz=) $(MANXSL) $>
gzip $(@:.gz=)
$(HTML_DIR)/man-html/$(MAN_PAGE:R).html: $(DOCBOOK_DIR)/$(MAN_PAGE:R).xml
$(DBPROC) -o $@ $(NOCHUNKBOOKXSL) $>
.endfor :
dockit: clean docs
tar zcf documentation-kit-0.10.tar.gz $(HTML_DIR)/
clean:
rm -f $(HTML_FILES)
rm -f $(NROFF_FILES)
rm -f $(DOCBOOK_DIR)/ExceptionCodes.xml
rm -f documentation-kit-0.10.tar.gz
|