make the clean_libraries target work, so you can "make clean" in libraries/
[ghc-hetmet.git] / rules / haddock.mk
index e2efc92..371d5e1 100644 (file)
@@ -21,6 +21,8 @@ else
 $$(error Already got a haddock file for $$($1_PACKAGE))
 endif
 
+haddock: $$($$($1_PACKAGE)_HADDOCK_FILE)
+
 ifeq "$$(HADDOCK_DOCS)" "YES"
 $(call all-target,$1_$2_haddock,$$($$($1_PACKAGE)_HADDOCK_FILE))
 endif
@@ -35,6 +37,10 @@ $$($$($1_PACKAGE)_HADDOCK_FILE) : $$(MKDIRHIER) $$(INPLACE_BIN)/haddock$$(exeext
        $$(MKDIRHIER) $$(dir $$@)
        $$(GHC_CABAL_INPLACE) haddock $2 $1 --with-haddock=$$(TOP)/$$(INPLACE_BIN)/haddock --with-ghc=$$(TOP)/$$(INPLACE_BIN)/ghc-stage2 $$($1_$2_HADDOCK_FLAGS) $$($1_$2_HADDOCK_OPTS)
 
+# Make the haddocking depend on the library .a file, to ensure
+# that we wait until the library is fully build before we haddock it
+$$($$($1_PACKAGE)_HADDOCK_FILE) : $$($1_$2_v_LIB)
+
 endif
 
 endef