X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rules%2Fhaddock.mk;h=99e0df66a5c9cd2c864ee8f1a0b6f048c6612fcd;hb=e11c554e94c39223ea55991a552ccb244dfe4364;hp=295db948873009845cca9579bdcafedfbabeab6b;hpb=f875cc870c623cc5ea6aa53701100e7326a2efe8;p=ghc-hetmet.git diff --git a/rules/haddock.mk b/rules/haddock.mk index 295db94..99e0df6 100644 --- a/rules/haddock.mk +++ b/rules/haddock.mk @@ -12,6 +12,8 @@ define haddock # args: $1 = dir, $2 = distdir +$(call trace, haddock($1,$2)) +$(call profStart, haddock($1,$2)) ifneq "$$($1_$2_DO_HADDOCK)" "NO" @@ -22,7 +24,7 @@ else $$(error Already got a haddock file for $$($1_PACKAGE)) endif -haddock: $$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_FILE) +haddock: html_$1 ifeq "$$(HADDOCK_DOCS)" "YES" $(call all-target,$1_$2_haddock,html_$1) @@ -44,17 +46,25 @@ ifeq "$$(HSCOLOUR_SRCS)" "YES" endif "$$(TOP)/$$(INPLACE_BIN)/haddock" \ --odir="$1/$2/doc/html/$$($1_PACKAGE)" \ + --no-tmp-comp-dir \ --dump-interface=$$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_FILE) \ --html \ + --hoogle \ --title="$$($1_PACKAGE)-$$($1_$2_VERSION)$$(if $$(strip $$($1_$2_SYNOPSIS)),: $$(strip $$($1_$2_SYNOPSIS)),)" \ --prologue="$1/$2/haddock-prologue.txt" \ $$(foreach mod,$$($1_$2_HIDDEN_MODULES),--hide=$$(mod)) \ - $$(foreach pkg,$$($1_$2_DEPS),$$(if $$($$(pkg)_HADDOCK_FILE),--read-interface=../$$(pkg)$$(comma)$$($$(pkg)_HADDOCK_FILE))) \ + $$(foreach pkg,$$($1_$2_DEPS),$$(if $$($$(pkg)_HADDOCK_FILE),--read-interface=../$$(pkg)$$(comma)../$$(pkg)/src/%{MODULE/./-}.html\#%{NAME}$$(comma)$$($$(pkg)_HADDOCK_FILE))) \ $$(foreach opt,$$($1_$2_v_ALL_HC_OPTS),--optghc=$$(opt)) \ $$($1_$2_HADDOCK_FLAGS) $$($1_$2_HADDOCK_OPTS) \ $$($1_$2_HS_SRCS) \ $$($1_$2_EXTRA_HADDOCK_SRCS) +# --no-tmp-comp-dir above is important: it saves a few minutes in a +# validate. This flag lets Haddock use the pre-compiled object files +# for the package rather than rebuilding the modules of the package in +# a temporary directory. Haddock needs to build the package when it +# uses the Template Haskell or Annotations extensions, for example. + # 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) @@ -62,5 +72,6 @@ endif endif +$(call profEnd, haddock($1,$2)) endef