Fix build on cygwin: Normalise slashes in .depend files to be /
[ghc-hetmet.git] / rules / docbook.mk
index 9b8a4f1..ccc0fa4 100644 (file)
@@ -26,11 +26,14 @@ $(call all-target,$1,)
 
 ifeq "$$(BUILD_DOCBOOK_HTML)" "YES"
 $(call all-target,$1,html_$1)
+INSTALL_HTML_DOC_DIRS += $1/$2
+endif
 
 html_$1 : $1/$2/index.html
 
+ifneq "$$(BINDIST)" "YES"
 $1/$2/index.html: $$($1_DOCBOOK_SOURCES)
-       "$$(RM)" $$(RM_OPTS) -r $$(dir $$@)
+       "$$(RM)" $$(RM_OPTS_REC) $$(dir $$@)
        "$$(XSLTPROC)" --stringparam base.dir $$(dir $$@) \
                       --stringparam use.id.as.filename 1 \
                       --stringparam html.stylesheet fptools.css \
@@ -39,44 +42,35 @@ $1/$2/index.html: $$($1_DOCBOOK_SOURCES)
                       $$(XSLTPROC_HTML_STYLESHEET) \
                       $1/$2.xml
        cp mk/fptools.css $$(dir $$@)
-
-INSTALL_HTML_DOC_DIRS += $1/$2
-else
-html_$1 :
-       @echo "*** HTML documentation is disabled; BUILD_DOCBOOK_HTML = NO"
-       @exit 1
 endif
 
+
 .PHONY: ps_$1
 ifeq "$$(BUILD_DOCBOOK_PS)" "YES"
 $(call all-target,$1,ps_$1)
+INSTALL_DOCS += $1/$2.ps
+endif
 
 ps_$1 : $1/$2.ps
 
+ifneq "$$(BINDIST)" "YES"
 $1/$2.ps: $$($1_DOCBOOK_SOURCES)
        "$$(DBLATEX)" $$(DBLATEX_OPTS) $1/$2.xml --ps -o $$@
-
-INSTALL_DOCS += $1/$2.ps
-else
-ps_$1 :
-       @echo "*** PS documentation is disabled; BUILD_DOCBOOK_PS = NO"
-       @exit 1
+       [ -f $$@ ]
 endif
 
 ifeq "$$(BUILD_DOCBOOK_PDF)" "YES"
 $(call all-target,$1,pdf_$1)
+INSTALL_DOCS += $1/$2.pdf
+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 $$@
-
-INSTALL_DOCS += $1/$2.pdf
-else
-pdf_$1 :
-       @echo "*** PDF documentation is disabled; BUILD_DOCBOOK_PDF = NO"
-       @exit 1
+       [ -f $$@ ]
 endif
 
 endef