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)) ...@@ -666,17 +666,12 @@ $(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/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 --inplace
ifeq "$(phase)" "final" 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 endif
INSTALL_LIBRARY_DOCS += libraries/*.html libraries/*.gif libraries/*.css libraries/*.js INSTALL_LIBRARY_DOCS += libraries/dist-haddock/*
CLEAN_FILES += $(wildcard libraries/doc-index* \
libraries/haddock*.css \
libraries/haddock*.js \
libraries/index*.html \
libraries/*.gif)
endif endif
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
...@@ -1165,6 +1160,11 @@ $(foreach lib,$(PACKAGES_STAGE1) $(PACKAGES_STAGE2),\ ...@@ -1165,6 +1160,11 @@ $(foreach lib,$(PACKAGES_STAGE1) $(PACKAGES_STAGE2),\
$(eval $(call clean-target,libraries/$(lib),dist-install,libraries/$(lib)/dist-install))) $(eval $(call clean-target,libraries/$(lib),dist-install,libraries/$(lib)/dist-install)))
endif endif
clean : clean_haddock_index
.PHONY: clean_haddock_index
clean_haddock_index:
$(call removeTrees,libraries/dist-haddock)
clean : clean_bindistprep clean : clean_bindistprep
.PHONY: clean_bindistprep .PHONY: clean_bindistprep
clean_bindistprep: clean_bindistprep:
......
...@@ -4,18 +4,21 @@ set -e ...@@ -4,18 +4,21 @@ set -e
HADDOCK_ARGS= HADDOCK_ARGS=
[ -d dist-haddock ] || mkdir dist-haddock
cd dist-haddock
case $* in case $* in
--inplace) --inplace)
HADDOCK=../inplace/bin/haddock HADDOCK=../../inplace/bin/haddock
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" ]
then then
LIBS="`cat $REPO/ghc-packages`" LIBS="`cat ../$REPO/ghc-packages`"
LIBROOT="$REPO" LIBROOT="../$REPO"
else else
LIBS="$REPO" LIBS="$REPO"
LIBROOT="." LIBROOT=".."
fi fi
for LIB in $LIBS for LIB in $LIBS
do do
...@@ -34,9 +37,9 @@ case $* in ...@@ -34,9 +37,9 @@ case $* in
done done
;; ;;
*) *)
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`
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#/.*##'`
...@@ -50,7 +53,7 @@ esac ...@@ -50,7 +53,7 @@ esac
echo $HADDOCK_ARGS echo $HADDOCK_ARGS
$HADDOCK --gen-index --gen-contents -o . \ $HADDOCK --gen-index --gen-contents -o . \
-t "Haskell Hierarchical Libraries" \ -t "Haskell Hierarchical Libraries" \
-p "prologue.txt" \ -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