summaryrefslogtreecommitdiff
path: root/documentation/Makefile
blob: 02f1de31280b1200dc0441cbe3b4041177b367b2 (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
# Process DocBook to HTML

DBPROC=xsltproc
BOOKXSL=bb-book.xsl
NOCHUNKBOOKXSL=bb-nochunk-book.xsl
MANXSL=bb-man.xsl
HTMLPREFIX=box-html
VPATH= adminguide
.SUFFIXES: .html .xml .1 .5 .8

all: docs

docs: instguide adminguide manpages
	mkdir -p $(HTMLPREFIX)/images
	cp html/images/*.png $(HTMLPREFIX)/images/.
	cp html/*.css $(HTMLPREFIX)/.

adminguide: $(HTMLPREFIX)/adminguide/index.html 

$(HTMLPREFIX)/adminguide/index.html: adminguide.xml ExceptionCodes.xml $(BOOKXSL)
	# docname=`echo $@ | sed -e 's/\/index.html//'`
	$(DBPROC) -o $(HTMLPREFIX)/adminguide/ $(BOOKXSL) adminguide.xml

instguide: $(HTMLPREFIX)/instguide/index.html 

$(HTMLPREFIX)/instguide/index.html: instguide.xml $(BOOKXSL)
	$(DBPROC) -o $(HTMLPREFIX)/instguide/ $(BOOKXSL) instguide.xml

ExceptionCodes.xml: ../ExceptionCodes.txt
	perl ./generate_except_xml.pl

manpages: man-dirs man-nroff man-html

man-dirs: man-pages/.there $(HTMLPREFIX)/man-html/.there

$(HTMLPREFIX)/man-html/.there:
	if [ ! -d man-html ]; then mkdir -p $(HTMLPREFIX)/man-html; touch $(HTMLPREFIX)/man-html/.there; fi

man-pages/.there:
	if [ ! -d man-pages ]; then mkdir man-pages; touch man-pages/.there; fi

man-nroff: bbackupquery.8 bbackupctl.8 bbstoreaccounts.8 bbstored-config.8 \
	raidfile-config.8 bbstored-certs.8

man-html: bbackupquery.html bbackupctl.html bbstoreaccounts.html \
	bbstored-config.html raidfile-config.html bbstored-certs.html

# for BSD make:
.xml.html:
	$(DBPROC) -o $@ $(NOCHUNKBOOKXSL) $<
	cp $@ $(HTMLPREFIX)/man-html/.

# for GNU make:
#%.html: %.xml
#	$(DBPROC) -o $@ $(NOCHUNKBOOKXSL) $<
#	mv $@ $(HTMLPREFIX)/man-html/.

# for BSD make:
.xml.8:
	$(DBPROC) -o $(.TARGET) $(MANXSL) $(.IMPSRC)
	cp $(.TARGET) man-pages/
	rm -f man-pages/$(.TARGET).gz
	gzip -f -9 man-pages/$(.TARGET)

# for GNU make:
#%.8: %.xml
#	$(DBPROC) -o $@ $(MANXSL) $<
#	cp $@ man-pages/
#	rm -f man-pages/$@.gz
#	gzip -f -9 man-pages/$@

dockit: clean docs
	tar zcf documentation-kit-0.10.tar.gz $(HTMLPREFIX)/

clean:
	if [ -d ./$(HTMLPREFIX) ]; then rm -rf $(HTMLPREFIX) ; fi
	if [ -d ./man-pages ]; then  rm -rf ./man-pages/; fi
	if [ -f ExceptionCodes.xml ]; then rm ExceptionCodes.xml; fi
	if [ -f documentation-kit-0.10.tar.gz ]; then rm documentation-kit-0.10.tar.gz; fi