summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ghc.mk11
-rw-r--r--libraries/gen_contents_index9
-rw-r--r--rules/haddock.mk1
-rw-r--r--utils/ghc-cabal/ghc-cabal.hs2
4 files changed, 15 insertions, 8 deletions
diff --git a/ghc.mk b/ghc.mk
index 820c36cd90..8175db5e46 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -13,7 +13,6 @@
# ToDo List.
#
# * finish installation
-# * create doc index and contents
# * Windows: should we have ghc-pkg-<version>?
# * should we be stripping things?
# * install libgmp.a, gmp.h
@@ -590,6 +589,11 @@ libraries/base3-compat_dist-install_HC_OPTS += -XPackageImports
.PHONY: stage1_libs
stage1_libs : $(ALL_STAGE1_LIBS)
+libraries/index.html: $(ALL_HADDOCK_FILES)
+ cd libraries && sh gen_contents_index --inplace
+$(eval $(call all-target,library_doc_index,libraries/index.html))
+INSTALL_LIBRARY_DOCS += libraries/*.html libraries/*.gif libraries/*.css libraries/*.js
+
# -----------------------------------------------------------------------------
# Bootstrapping libraries
@@ -732,6 +736,9 @@ install_docs: $(INSTALL_HEADERS)
$(INSTALL_DOC) $(INSTALL_OPTS) $$i $(DESTDIR)$(docdir); \
done
$(INSTALL_DIR) $(INSTALL_OPTS) $(DESTDIR)$(docdir)/html; \
+ for i in $(INSTALL_LIBRARY_DOCS); do \
+ $(INSTALL_DOC) $(INSTALL_OPTS) $$i $(DESTDIR)$(docdir)/libraries/; \
+ done
for i in $(INSTALL_HTML_DOC_DIRS); do \
$(INSTALL_DIR) $(INSTALL_OPTS) $(DESTDIR)$(docdir)/html/`basename $$i`; \
$(INSTALL_DOC) $(INSTALL_OPTS) $$i/* $(DESTDIR)$(docdir)/html/`basename $$i`; \
@@ -786,7 +793,9 @@ $(eval $(call bindist,.,\
$(INSTALL_LIBEXEC_SCRIPTS) \
$(INSTALL_BINS) \
$(INSTALL_DOCS) \
+ $(INSTALL_LIBRARY_DOCS) \
$(addsuffix /*,$(INSTALL_HTML_DOC_DIRS)) \
+ $(wildcard libraries/*/dist-install/doc/) \
$(filter-out extra-gcc-opts,$(INSTALL_LIBS)) \
$(filter-out %/project.mk,$(filter-out mk/config.mk,$(MAKEFILE_LIST))) \
mk/fix_install_names.sh \
diff --git a/libraries/gen_contents_index b/libraries/gen_contents_index
index ea9f4b95e1..99efc8fcc6 100644
--- a/libraries/gen_contents_index
+++ b/libraries/gen_contents_index
@@ -7,12 +7,9 @@ NAMES=
case $* in
--inplace)
- HADDOCK=../utils/haddock/install-inplace/bin/haddock
- HADDOCK_FILES=`ls -1 */dist/doc/html/*/*.haddock | sort`
- if [ -d dph ]
- then
- HADDOCK_FILES="$HADDOCK_FILES `ls -1 dph/*/dist/doc/html/*/*.haddock | sort`"
- fi
+ HADDOCK=../inplace/bin/haddock
+ HADDOCK_FILES=`ls -1 */dist-install/doc/html/*/*.haddock | sort`
+ HADDOCK_FILES="$HADDOCK_FILES `ls -1 dph/*/dist-install/doc/html/*/*.haddock | sort`"
;;
*)
HADDOCK=../../../../bin/haddock
diff --git a/rules/haddock.mk b/rules/haddock.mk
index 6269612f53..a6ad82ef3d 100644
--- a/rules/haddock.mk
+++ b/rules/haddock.mk
@@ -17,6 +17,7 @@ ifneq "$$($1_$2_DO_HADDOCK)" "NO"
ifeq "$$($$($1_PACKAGE)_HADDOCK_FILE)" ""
$$($1_PACKAGE)_HADDOCK_FILE = $1/$2/doc/html/$$($1_PACKAGE)/$$($1_PACKAGE).haddock
+ALL_HADDOCK_FILES += $$($$($1_PACKAGE)_HADDOCK_FILE)
else
$$(error Already got a haddock file for $$($1_PACKAGE))
endif
diff --git a/utils/ghc-cabal/ghc-cabal.hs b/utils/ghc-cabal/ghc-cabal.hs
index 5979fb52da..a1bdf66ab6 100644
--- a/utils/ghc-cabal/ghc-cabal.hs
+++ b/utils/ghc-cabal/ghc-cabal.hs
@@ -124,7 +124,7 @@ doInstall ghcpkg ghcpkgconf directory distDir myDestDir myPrefix myLibdir myDocd
idts' = idts { prefix = toPathTemplate myPrefix,
libdir = toPathTemplate myLibdir,
libsubdir = toPathTemplate "$pkgid",
- docdir = toPathTemplate (myDocdir </> "$pkgid"),
+ docdir = toPathTemplate (myDocdir </> "$pkg"),
htmldir = toPathTemplate "$docdir" }
progs = withPrograms lbi
prog = ConfiguredProgram {