X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=rules%2Fdocbook.mk;h=5a7bfdfd8320ad147b5d67090e8db1a4a9888f98;hp=3eb5d94527b56447181f5a13d91be9ce91d2114c;hb=e5c3b478b3cd1707cf122833822f44b2ac09b8e9;hpb=1cce2f51656cfbd8c7933a914a4bd981792aa1e6 diff --git a/rules/docbook.mk b/rules/docbook.mk index 3eb5d94..5a7bfdf 100644 --- a/rules/docbook.mk +++ b/rules/docbook.mk @@ -14,37 +14,73 @@ # Build docbook docs define docbook +$(call trace, docbook($1,$2)) +$(call profStart, docbook($1,$2)) # $1 = dir # $2 = docname $(call clean-target,$1,docbook,$1/$2 $1/$2.pdf $1/$2.ps) +# empty "all_$1" target just in case we're not building docs at all +$(call all-target,$1,) + +.PHONY: html_$1 + +ifeq "$$(phase)" "final" ifeq "$$(BUILD_DOCBOOK_HTML)" "YES" -$(call all-target,$1_html,$1/$2/index.html) +$(call all-target,$1,html_$1) +INSTALL_HTML_DOC_DIRS += $1/$2 +endif +endif + +html_$1 : $1/$2/index.html +ifneq "$$(BINDIST)" "YES" $1/$2/index.html: $$($1_DOCBOOK_SOURCES) - $$(RM) -r $$(dir $$@) - $$(XSLTPROC) --stringparam base.dir $$(dir $$@) \ - --stringparam use.id.as.filename 1 \ - --stringparam html.stylesheet fptools.css \ - $$(XSLTPROC_LABEL_OPTS) $$(XSLTPROC_OPTS) \ - $$(DIR_DOCBOOK_XSL)/html/chunk.xsl $1/$2.xml + "$$(RM)" $$(RM_OPTS_REC) $$(dir $$@) + "$$(XSLTPROC)" --stringparam base.dir $$(dir $$@) \ + --stringparam use.id.as.filename 1 \ + --stringparam html.stylesheet fptools.css \ + --nonet \ + $$(XSLTPROC_LABEL_OPTS) $$(XSLTPROC_OPTS) \ + $$(XSLTPROC_HTML_STYLESHEET) \ + $1/$2.xml cp mk/fptools.css $$(dir $$@) endif + +.PHONY: ps_$1 +ifeq "$$(phase)" "final" ifeq "$$(BUILD_DOCBOOK_PS)" "YES" -$(call all-target,$1_ps,$1/$2.ps) +$(call all-target,$1,ps_$1) +INSTALL_DOCS += $1/$2.ps +endif +endif + +ps_$1 : $1/$2.ps +ifneq "$$(BINDIST)" "YES" $1/$2.ps: $$($1_DOCBOOK_SOURCES) - $$(DBLATEX) $$(DBLATEX_OPTS) $1/$2.xml --ps -o $$@ + "$$(DBLATEX)" $$(DBLATEX_OPTS) $1/$2.xml --ps -o $$@ + [ -f $$@ ] endif +ifeq "$$(phase)" "final" ifeq "$$(BUILD_DOCBOOK_PDF)" "YES" -$(call all-target,$1_pdf,$1/$2.pdf) +$(call all-target,$1,pdf_$1) +INSTALL_DOCS += $1/$2.pdf +endif +endif + +.PHONY: pdf_$1 +pdf_$1 : $1/$2.pdf +ifneq "$$(BINDIST)" "YES" $1/$2.pdf: $$($1_DOCBOOK_SOURCES) - $$(DBLATEX) $$(DBLATEX_OPTS) $1/$2.xml --pdf -o $$@ + "$$(DBLATEX)" $$(DBLATEX_OPTS) $1/$2.xml --pdf -o $$@ + [ -f $$@ ] endif +$(call profEnd, docbook($1,$2)) endef