Commit 4e29038c authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Tweak the gen_contents_index script

parent ed803061
...@@ -702,7 +702,7 @@ $(foreach p,$(PACKAGES_STAGE0),$(eval libraries/$p_dist-boot_DO_HADDOCK = NO)) ...@@ -702,7 +702,7 @@ $(foreach p,$(PACKAGES_STAGE0),$(eval libraries/$p_dist-boot_DO_HADDOCK = NO))
# Build the Haddock contents and index # Build the Haddock contents and index
ifeq "$(HADDOCK_DOCS)" "YES" ifeq "$(HADDOCK_DOCS)" "YES"
libraries/dist-haddock/index.html: inplace/bin/haddock$(exeext) $(ALL_HADDOCK_FILES) libraries/dist-haddock/index.html: inplace/bin/haddock$(exeext) $(ALL_HADDOCK_FILES)
cd libraries && sh gen_contents_index --inplace cd libraries && sh gen_contents_index --intree
ifeq "$(phase)" "final" ifeq "$(phase)" "final"
$(eval $(call all-target,library_doc_index,libraries/dist-haddock/index.html)) $(eval $(call all-target,library_doc_index,libraries/dist-haddock/index.html))
endif endif
......
...@@ -2,20 +2,18 @@ ...@@ -2,20 +2,18 @@
set -e set -e
USAGE="Usage: $0 [--inplace] [--verbose] [--help]" USAGE="Usage: $0 [--intree] [--verbose] [--help]"
INPLACE= INTREE=
VERBOSE= VERBOSE=
HADDOCK_ARGS= HADDOCK_ARGS=
[ -d dist-haddock ] || mkdir dist-haddock
cd dist-haddock
while [ "$#" -ne "0" ] while [ "$#" -ne "0" ]
do do
case "$1" in case "$1" in
--inplace) --intree)
INPLACE=yes # We're in a GHC build tree
INTREE=yes
;; ;;
--verbose) --verbose)
VERBOSE=yes VERBOSE=yes
...@@ -29,9 +27,13 @@ do ...@@ -29,9 +27,13 @@ do
shift shift
done done
if [ -n "$INPLACE" ] if [ -n "$INTREE" ]
then then
[ -d dist-haddock ] || mkdir dist-haddock
cd dist-haddock
HADDOCK=../../inplace/bin/haddock HADDOCK=../../inplace/bin/haddock
HADDOCK_ARGS="-p ../prologue.txt"
for REPO in `grep '^libraries/[^ ]* *- ' ../../packages | sed -e 's#libraries/##' -e 's/ .*//'` for REPO in `grep '^libraries/[^ ]* *- ' ../../packages | sed -e 's#libraries/##' -e 's/ .*//'`
do do
if [ -f "../$REPO/ghc-packages" ] if [ -f "../$REPO/ghc-packages" ]
...@@ -58,9 +60,10 @@ then ...@@ -58,9 +60,10 @@ then
done done
done done
else else
HADDOCK=../../../../../../bin/haddock HADDOCK=../../../../../bin/haddock
# We don't want the GHC API to swamp the index # We don't want the GHC API to swamp the index
HADDOCK_FILES=`ls -1 ../*/*.haddock | grep -v '/ghc\.haddock' | sort` HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort`
HADDOCK_ARGS="-p prologue.txt"
for HADDOCK_FILE in $HADDOCK_FILES for HADDOCK_FILE in $HADDOCK_FILES
do do
NAME_VERSION=`echo "$HADDOCK_FILE" | sed 's#/.*##'` NAME_VERSION=`echo "$HADDOCK_FILE" | sed 's#/.*##'`
...@@ -76,7 +79,6 @@ then ...@@ -76,7 +79,6 @@ then
fi fi
$HADDOCK --gen-index --gen-contents -o . \ $HADDOCK --gen-index --gen-contents -o . \
-t "Haskell Hierarchical Libraries" \ -t "Haskell Hierarchical Libraries" \
-p "../prologue.txt" \
$HADDOCK_ARGS $HADDOCK_ARGS
# Unhandled Windows help stuff?: # Unhandled Windows help stuff?:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment