Whamcloud - gitweb
LUDOC-321 style: ensure ID attributes are unique.
[doc/manual.git] / Makefile
index 5f30015..4bd139b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ MASTER_URL_LAB=http://build.lab.whamcloud.com:8080/job/lustre-manual/lastSuccess
 MASTER_XHTML=$(MASTER_URL)/artifact/$(TGT_BASE).xhtml
 MASTER_XHTML_LAB=$(MASTER_URL_LAB)/artifact/$(TGT_BASE).xhtml
 TGT_MASTER=$(TMP)/mastermanual
+CHUNKED_HTML=chunked-html
 
 
 RNG_UBN=/usr/share/xml/docbook/schema/rng/5.0/docbookxi.rng
@@ -20,27 +21,38 @@ RNG=$(or $(shell ls $(RNG_UBN) 2> /dev/null), \
 XSL_UBN=/usr/share/xml/docbook/stylesheet/docbook-xsl-ns
 XSL_REL=/usr/share/sgml/docbook/xsl-ns-stylesheets-1.75.2
 XSL_F16=/usr/share/sgml/docbook/xsl-ns-stylesheets
+XSL_SLE=/usr/share/xml/docbook/stylesheet/nwalsh5/current
 XSL_MAC=/opt/local/share/xsl/docbook-xsl
 XSL=$(or $(shell ls -d $(XSL_UBN) 2> /dev/null), \
         $(shell ls -d $(XSL_REL) 2> /dev/null), \
         $(shell ls -d $(XSL_F16) 2> /dev/null), \
+        $(shell ls -d $(XSL_SLE) 2> /dev/null), \
         $(shell ls -d $(XSL_MAC) 2> /dev/null))
+PRIMARYXSL=$(XSL)/$(subst $(TGT_BASE).,,$@)/docbook.xsl
+PRIMARYCHUNKXSL=$(XSL)/html/chunkfast.xsl
 
 .PHONY: all
-all: clean check xhtml html pdf epub diff
+all: clean check xhtml html chunked-html pdf epub
 
 .PHONY: check
 check: $(SRC_XML)
        xmllint --noout --xinclude --noent --relaxng $(RNG) ./index.xml
 
 # Note: can't use "suffix" instead of "subst", because it keeps the '.'
-$(TGT_BASE).html $(TGT_BASE).xhtml $(TGT_BASE).fo $(TGT_BASE).epub: $(SRCS)
-       xsltproc --stringparam fop1.extensions  1 \
-               --stringparam section.label.includes.component.label 1 \
-               --stringparam section.autolabel 1 \
-               --stringparam chapter.autolabel 1 \
-               --stringparam appendix.autolabel 1 \
-               --xinclude -o $@ $(XSL)/$(subst $(TGT_BASE).,,$@)/docbook.xsl ./index.xml
+# Note: xsl:import is resolved at compile time, so the primary xsl
+#   is substituted into the custom xsl with sed before compliation.
+$(CHUNKED_HTML)/%.html: $(SRCS)
+       sed -e 's;PRIMARYXSL;${PRIMARYCHUNKXSL};' ./style/customstyle.xsl | \
+       xsltproc --xinclude -o ${CHUNKED_HTML}/ - ./index.xml
+
+$(TGT_BASE).html $(TGT_BASE).xhtml $(TGT_BASE).epub: $(SRCS)
+       sed -e 's;PRIMARYXSL;${PRIMARYXSL};' ./style/customstyle.xsl | \
+       xsltproc --xinclude -o $@ - ./index.xml
+
+$(TGT_BASE).fo: $(SRCS)
+       sed -e 's;PRIMARYXSL;${PRIMARYXSL};' ./style/customstyle_fo.xsl | \
+       xsltproc --xinclude -o $@ - ./index.xml
+
 
 $(TGT_BASE).pdf: $(TGT_BASE).fo
                fop $< $@
@@ -58,10 +70,16 @@ pdf: $(TGT_BASE).pdf
 epub: $(TGT_BASE).epub
        echo "application/epub+zip" > mimetype
        cp -r ./figures ./OEBPS/
+       mkdir ./OEBPS/style
+       cp ./style/manual.css ./OEBPS/style/
        zip -0Xq $(TGT_BASE).epub mimetype
        zip -Xr9D $(TGT_BASE).epub OEBPS/*
        zip -Xr9D $(TGT_BASE).epub META-INF/*
 
+.PHONY: chunked-html
+chunked-html: $(CHUNKED_HTML)/%.html
+       cp -r ./figures ./${CHUNKED_HTML}
+
 
 # get the git hash for the last successful build of the manual
 .PHONY: mastermanual.revision
@@ -84,11 +102,11 @@ diff: $(TGT_BASE).xhtml $(TGT_MASTER).xhtml
 
 .PHONY: push
 push:
-       git push ssh://review.whamcloud.com:29418/doc/manual HEAD:refs/for/master
+       git push ssh://review.hpdd.intel.com:29418/doc/manual HEAD:refs/for/master
 
 .PHONY: clean
 clean:
        rm -f $(TGT_BASE).html $(TGT_BASE).xhtml $(TGT_BASE).pdf\
                mastermanual.revision mastermanual.index mimetype\
-               $(TGT_BASE).diff.html
-       rm -rf ./META-INF ./OEBPS
+               $(TGT_BASE).diff.html $(TGT_BASE).epub $(TGT_BASE).fo
+       rm -rf ./META-INF ./OEBPS ./$(TGT_BASE)