-$(TGT_BASE).html $(TGT_BASE).xhtml $(TGT_BASE).fo: $(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
+