1 SRC_XML=$(wildcard *.xml)
2 SRC_IMG=$(wildcard figures/*.png)
3 SRCS=$(SRC_XML) $(SRC_IMG)
7 MASTER_URL=http://build.whamcloud.com/job/lustre-manual/lastSuccessfulBuild/
8 MASTER_XHTML=$(MASTER_URL)/artifact/_out/$(TGT_BASE).xhtml
9 TGT_MASTER=$(TEMP)/mastermanual
12 RNG_LIN=/usr/share/xml/docbook/schema/rng/5.0/docbookxi.rng
13 RNG_MAC=/opt/local/share/xml/docbook/5.0/rng/docbookxi.rng
14 RNG=$(or $(shell ls $(RNG_LIN) 2> /dev/null), \
15 $(shell ls $(RNG_MAC) 2> /dev/null))
16 XSL_LIN=/usr/share/xml/docbook/stylesheet/docbook-xsl-ns
17 XSL_MAC=/opt/local/share/xsl/docbook-xsl
18 XSL=$(or $(shell ls -d $(XSL_LIN) 2> /dev/null), \
19 $(shell ls -d $(XSL_MAC) 2> /dev/null))
23 xmllint --noout --xinclude --noent --relaxng $(RNG) ./index.xml
25 # Note: can't use "suffix" instead of "subst", because it keeps the '.'
26 $(TGT_BASE).html $(TGT_BASE).xhtml $(TGT_BASE).fo: $(SRCS)
27 xsltproc --stringparam fop1.extensions 1 \
28 --stringparam section.label.includes.component.label 1 \
29 --stringparam section.autolabel 1 \
30 --stringparam chapter.autolabel 1 \
31 --stringparam appendix.autolabel 1 \
32 --xinclude -o $@ $(XSL)/$(subst $(TGT_BASE).,,$@)/docbook.xsl ./index.xml
34 $(TGT_BASE).pdf: $(TGT_BASE).fo
38 html: $(TGT_BASE).html
41 xhtml: $(TGT_BASE).xhtml
46 # get the git hash for the last successful build of the manual
47 .PHONY: mastermanual.revision
48 mastermanual.revision:
49 wget -O mastermanual.index $(MASTER_URL)
50 awk '/Revision/ { print $$NF }' mastermanual.index > mastermanual.revision
52 # only fetch the full manual if we don't have it or the manual changed
53 $(TGT_MASTER).xhtml: mastermanual.revision
54 if ! cmp -s mastermanual.revision $(TGT_MASTER).revision ; then\
55 wget -O $(TGT_MASTER).xhtml $(MASTER_XHTML) && \
56 mv mastermanual.revision $(TGT_MASTER).revision;\
60 diff: $(TGT_BASE).xhtml $(TGT_MASTER).xhtml
61 ./tools/diff.py $(TGT_MASTER).xhtml $(TGT_BASE).xhtml > $(TGT_BASE).diff
66 git push ssh://review.whamcloud.com:29418/doc/manual HEAD:refs/for/master
70 rm $(TGT_BASE).html $(TGT_BASE).xhtml $(TGT_BASE).pdf