Fix creation of library doc index, and put the library docs in bindists
[ghc-hetmet.git] / rules / haddock.mk
index 67286f5..a6ad82e 100644 (file)
@@ -17,6 +17,7 @@ ifneq "$$($1_$2_DO_HADDOCK)" "NO"
 
 ifeq "$$($$($1_PACKAGE)_HADDOCK_FILE)" ""
 $$($1_PACKAGE)_HADDOCK_FILE = $1/$2/doc/html/$$($1_PACKAGE)/$$($1_PACKAGE).haddock
+ALL_HADDOCK_FILES += $$($$($1_PACKAGE)_HADDOCK_FILE)
 else
 $$(error Already got a haddock file for $$($1_PACKAGE))
 endif
@@ -24,9 +25,12 @@ endif
 haddock: $$($$($1_PACKAGE)_HADDOCK_FILE)
 
 ifeq "$$(HADDOCK_DOCS)" "YES"
-$(call all-target,$1_$2_haddock,$$($$($1_PACKAGE)_HADDOCK_FILE))
+$(call all-target,$1_$2_haddock,html_$1)
 endif
 
+.PHONY: html_$1
+html_$1 : $$($$($1_PACKAGE)_HADDOCK_FILE)
+
 $$($1_PACKAGE)_HADDOCK_DEPS = $$(foreach n,$$($1_$2_DEP_NAMES),$$($$n_HADDOCK_FILE))
 
 ifeq "$$(HSCOLOUR_SRCS)" "YES"