Commit 4c49eb51 authored by Ian Lynagh's avatar Ian Lynagh

Generate the haddock contents/index pages in a dist-haddock subdirectory

This is tidier, and makes it easier to clean and install them correctly
parent c2a840ed
......@@ -666,17 +666,12 @@ $(foreach p,$(PACKAGES_STAGE0),$(eval libraries/$p_dist-boot_DO_HADDOCK = NO))
# Build the Haddock contents and index
ifeq "$(HADDOCK_DOCS)" "YES"
libraries/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
ifeq "$(phase)" "final"
$(eval $(call all-target,library_doc_index,libraries/index.html))
$(eval $(call all-target,library_doc_index,libraries/dist-haddock/index.html))
endif
INSTALL_LIBRARY_DOCS += libraries/*.html libraries/*.gif libraries/*.css libraries/*.js
CLEAN_FILES += $(wildcard libraries/doc-index* \
libraries/haddock*.css \
libraries/haddock*.js \
libraries/index*.html \
libraries/*.gif)
INSTALL_LIBRARY_DOCS += libraries/dist-haddock/*
endif
# -----------------------------------------------------------------------------
......@@ -1165,6 +1160,11 @@ $(foreach lib,$(PACKAGES_STAGE1) $(PACKAGES_STAGE2),\
$(eval $(call clean-target,libraries/$(lib),dist-install,libraries/$(lib)/dist-install)))
endif
clean : clean_haddock_index
.PHONY: clean_haddock_index
clean_haddock_index:
$(call removeTrees,libraries/dist-haddock)
clean : clean_bindistprep
.PHONY: clean_bindistprep
clean_bindistprep:
......
......@@ -4,18 +4,21 @@ set -e
HADDOCK_ARGS=
[ -d dist-haddock ] || mkdir dist-haddock
cd dist-haddock
case $* in
--inplace)
HADDOCK=../inplace/bin/haddock
for REPO in `grep '^libraries/[^ ]* *- ' ../packages | sed -e 's#libraries/##' -e 's/ .*//'`
HADDOCK=../../inplace/bin/haddock
for REPO in `grep '^libraries/[^ ]* *- ' ../../packages | sed -e 's#libraries/##' -e 's/ .*//'`
do
if [ -f "$REPO/ghc-packages" ]
if [ -f "../$REPO/ghc-packages" ]
then
LIBS="`cat $REPO/ghc-packages`"
LIBROOT="$REPO"
LIBS="`cat ../$REPO/ghc-packages`"
LIBROOT="../$REPO"
else
LIBS="$REPO"
LIBROOT="."
LIBROOT=".."
fi
for LIB in $LIBS
do
......@@ -34,9 +37,9 @@ case $* in
done
;;
*)
HADDOCK=../../../../../bin/haddock
HADDOCK=../../../../../../bin/haddock
# 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`
for HADDOCK_FILE in $HADDOCK_FILES
do
NAME_VERSION=`echo "$HADDOCK_FILE" | sed 's#/.*##'`
......@@ -50,7 +53,7 @@ esac
echo $HADDOCK_ARGS
$HADDOCK --gen-index --gen-contents -o . \
-t "Haskell Hierarchical Libraries" \
-p "prologue.txt" \
-p "../prologue.txt" \
$HADDOCK_ARGS
# 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