# -----------------------------------------------------------------------------
docdir := $(docdir)/libraries/$$pkgid
-ifeq "$(Windows)" "YES"
+ifeq "$(RelocatableBuild)" "YES"
# On Windows we want to make moveable bindists, but we need to tell
# ghc-pkg where the haddock docs are. Therefore we completely ignore
# where the user tells us to put the haddock documentation and put it
# "C:\\Program Files\\Common Files"
# on Windows
-# We also set libsubdir differently on Windows and non-Windows, as on
-# non-Windows the path we deduce is higher up than the path passed to
-# the executable with the shell script on non-Windows. This should
-# probably be tidied up so that we can always pass the same libsubdir.
-ifeq "$(Windows)" "YES"
-libsubdir = $$pkgid
-else
-libsubdir = $$compiler/lib/$$pkgid
-endif
-
# We rely on all the CONFIGURE_ARGS being quoted with '...', and there
# being no 's inside the values.
FLAGGED_CONFIGURE_ARGS = $(subst $(space)',\
( cd $* && setup/Setup configure \
$(CONFIGURE_OPTS) \
--prefix='$$topdir' \
- --docdir='$(docdir)' \
- --htmldir='$(htmldir_configure)' \
+ --bindir='$(bindir)' \
+ --libdir='$(libdir)/lib' \
+ --libsubdir='$$pkgid' \
+ --libexecdir='$(libexecdir)' \
--datadir='$(datadir)' \
- --libsubdir='$(libsubdir)' \
- --with-compiler=../../compiler/stage1/ghc-inplace$ \
- --with-hc-pkg=../../utils/ghc-pkg/ghc-pkg-inplace$ \
+ --docdir='$(docdir)' \
+ --htmldir='$(htmldir_configure)' \
+ --with-compiler=../../compiler/stage1/ghc-inplace \
+ --with-hc-pkg=../../utils/ghc-pkg/ghc-pkg-inplace \
--with-hsc2hs=../../utils/hsc2hs/hsc2hs-inplace \
--with-ld=$(LD) \
--haddock-options="--use-contents=../index.html \
&& touch $@ || touch $*/unbuildable
# We don't touch $@ if configure failed as we would prefer to try
# configuring it next time round, rather than assuming it'll still fail.
-# This is particularly important for corelibs, where failure means the
+# This is particularly important for bootlibs, where failure means the
# build dies!
# Build the library using 'make'
$(RM) -rf bootstrapping.*
$(RM) -rf ifBuildable
$(RM) -rf installPackage
- $(RM) -f libraries.txt index.html doc-index.html doc-index-*.html
+ $(RM) -f libraries.txt index.html doc-index.html doc-index*.html
+
+distclean:
+ $(RM) $(foreach lib, $(SUBDIRS), $(lib)/.depend $(lib)/.depend.bak)
$(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR)): \
clean.library.%:
install: $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR))
ifeq "$(HADDOCK_DOCS)" "YES"
- $(INSTALL_DIR) $(DESTDIR)$(htmldir_install)
- $(INSTALL_DATA) index.html doc-index.html $(DESTDIR)$(htmldir_install)
- $(INSTALL_SCRIPT) gen_contents_index $(DESTDIR)$(htmldir_install)
+ $(INSTALL_DIR) $(DESTDIR)$(htmldir_install)
+ $(INSTALL_DATA) index.html doc-index*.html $(DESTDIR)$(htmldir_install)
+ $(INSTALL_SCRIPT) gen_contents_index $(DESTDIR)$(htmldir_install)
# Hacks:
- $(INSTALL_DATA) $(DESTDIR)$(htmldir_install)/base/*.css $(DESTDIR)$(htmldir_install)
- $(INSTALL_DATA) $(DESTDIR)$(htmldir_install)/base/*.js $(DESTDIR)$(htmldir_install)
- $(INSTALL_DATA) $(DESTDIR)$(htmldir_install)/base/*.gif $(DESTDIR)$(htmldir_install)
+ $(INSTALL_DATA) $(DESTDIR)$(htmldir_install)/base-*/*.css $(DESTDIR)$(htmldir_install)
+ $(INSTALL_DATA) $(DESTDIR)$(htmldir_install)/base-*/*.js $(DESTDIR)$(htmldir_install)
+ $(INSTALL_DATA) $(DESTDIR)$(htmldir_install)/base-*/*.gif $(DESTDIR)$(htmldir_install)
endif
# Cabal doesn't let us ask to install docs only, so do nothing here
# prefix and (on Windows) htmldir use $topdir when configuring, so we
# need to tell installPackage the real path to use when installing.
+# We also need to pass all the other directories in, as they can be
+# overridden when installing a bindist.
+
$(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \
install.library.%: installPackage/installPackage ifBuildable/ifBuildable
if ifBuildable/ifBuildable $*; then \
cd $* && \
- ../installPackage/installPackage '$(DESTDIR)' '$(prefix)' '$(htmldir_install)' '$(GHC_PKG_PROG)' '$(DESTDIR)$(libdir)/package.conf' ; \
+ ../installPackage/installPackage '$(DESTDIR)' '$(prefix)' '$(bindir)' '$(libdir)/lib' '$(libexecdir)' '$(datadir)' '$(docdir)' '$(htmldir_install)' '$(htmldir_configure)' '$(GHC_PKG_PROG)' '$(DESTDIR)$(libdir)/package.conf' ; \
fi
.PHONY: binary-dist binary-dist.library.%
ifeq "$(HADDOCK_DOCS)" "YES"
cp gen_contents_index $(BIN_DIST_LIBDIR)
cp index.html $(BIN_DIST_LIBDIR)
- cp doc-index.html $(BIN_DIST_LIBDIR)
+ cp doc-index*.html $(BIN_DIST_LIBDIR)
endif
cp -pR stamp $(BIN_DIST_LIBDIR)