Docs: make sure all libs are included in index.html (#10879)
Docs: make sure all libs are included in index.html (#10879)

During the build, when HADDOCK_DOCS=YES, the command 'cd libraries && sh
gen_contents_index --intree' is run, which calls haddock to generate the
haddock index at 'libraries/dist-haddock/index.html'.

What it did before was check the ./packages file for all libraries. The
problem is that 'base' and 'ghc-prim' were folded into the main repo
some time ago, hence don't have an entry in the ./packages file anymore.
As a result, 'base' and 'ghc-prim' were missing from the index.html
file.

It now simply runs haddock on all the all the `.haddock` files in the
libraries directory.

The only risk is that this could include the extra libraries in the
index.html, if you ever built them in the past (with
BUILD_EXTRA_PKGS=YES), even though now you want to exclude them (with
BUILD_EXTRA_PKGS=NO). gen_contents_index doesn't have access to build
system variables though (PACKAGES_STAGE1+PACKAGES_STAGE2), so fixing
this would be a little bit fiddly.

Test Plan:
'make libraries/dist-haddock/index.html && grep -q base
libraries/dist-haddock/index.html && echo ok'

Reviewed by: austin

Differential Revision: https://phabricator.haskell.org/D1247

ghc-android/ghc,mettekou/ghc,ezyang/ghc,oldmanmike/ghc,ml9951/ghc,AlexanderPankiv/ghc,oldmanmike/ghc,snoyberg/ghc,AlexanderPankiv/ghc,shlevy/ghc,ml9951/ghc,nushio3/ghc,olsner/ghc,GaloisInc/halvm-ghc,shlevy/ghc,da-x/ghc,sgillespie/ghc,vTurbine/ghc,vikraman/ghc,nushio3/ghc,snoyberg/ghc,sgillespie/ghc,elieux/ghc,ghc-android/ghc,gridaphobe/ghc,nushio3/ghc,siddhanathan/ghc,GaloisInc/halvm-ghc,snoyberg/ghc,elieux/ghc,ml9951/ghc,vTurbine/ghc,mcschroeder/ghc,gridaphobe/ghc,vikraman/ghc,vikraman/ghc,GaloisInc/halvm-ghc,tjakway/ghcjvm,olsner/ghc,vikraman/ghc,siddhanathan/ghc,vikraman/ghc,vikraman/ghc,olsner/ghc,sdiehl/ghc,ghc-android/ghc,mcschroeder/ghc,ghc-android/ghc,AlexanderPankiv/ghc,siddhanathan/ghc,mettekou/ghc,nushio3/ghc,ezyang/ghc,GaloisInc/halvm-ghc,nushio3/ghc,ezyang/ghc,shlevy/ghc,ml9951/ghc,oldmanmike/ghc,tjakway/ghcjvm,sgillespie/ghc,siddhanathan/ghc,mcschroeder/ghc,olsner/ghc,sgillespie/ghc,elieux/ghc,vTurbine/ghc,AlexanderPankiv/ghc,mcschroeder/ghc,elieux/ghc,snoyberg/ghc,ml9951/ghc,AlexanderPankiv/ghc,gridaphobe/ghc,gridaphobe/ghc,sdiehl/ghc,GaloisInc/halvm-ghc,oldmanmike/ghc,ezyang/ghc,vTurbine/ghc,oldmanmike/ghc,shlevy/ghc,sgillespie/ghc,sgillespie/ghc,ml9951/ghc,ml9951/ghc,mcschroeder/ghc,tjakway/ghcjvm,gridaphobe/ghc,shlevy/ghc,tjakway/ghcjvm,mcschroeder/ghc,mettekou/ghc,AlexanderPankiv/ghc,da-x/ghc,tjakway/ghcjvm,AlexanderPankiv/ghc,olsner/ghc,nushio3/ghc,siddhanathan/ghc,siddhanathan/ghc,snoyberg/ghc,sdiehl/ghc,ghc-android/ghc,nushio3/ghc,vTurbine/ghc,mettekou/ghc,snoyberg/ghc,ezyang/ghc,da-x/ghc,da-x/ghc,vikraman/ghc,elieux/ghc,shlevy/ghc,vTurbine/ghc,siddhanathan/ghc,mettekou/ghc,ml9951/ghc,da-x/ghc,ezyang/ghc,mcschroeder/ghc,olsner/ghc,shlevy/ghc,vTurbine/ghc,GaloisInc/halvm-ghc,ghc-android/ghc,mettekou/ghc,mettekou/ghc,ghc-android/ghc,sdiehl/ghc,tjakway/ghcjvm,sdiehl/ghc,GaloisInc/halvm-ghc,sgillespie/ghc,elieux/ghc,gridaphobe/ghc,oldmanmike/ghc,da-x/ghc,sdiehl/ghc,elieux/ghc,snoyberg/ghc,oldmanmike/ghc,sdiehl/ghc,olsner/ghc,gridaphobe/ghc,ezyang/ghc,da-x/ghc,tjakway/ghcjvm