X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=libraries%2FMakefile;h=240bcc82bcb00c90119e04b4acade5de2cae53f2;hp=ae92be9237630e38a400ddf24f3c782294b05895;hb=7022469ab84b59f18ce4ad0dbae2b81b5274a2b9;hpb=d5796081409525eec5751e7ef2192a94d2e61c5a diff --git a/libraries/Makefile b/libraries/Makefile index ae92be9..240bcc8 100644 --- a/libraries/Makefile +++ b/libraries/Makefile @@ -91,6 +91,22 @@ space=$(empty) $(empty) # ----------------------------------------------------------------------------- +docdir := $(docdir)/libraries/$$pkgid +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 +# somewhere whose relative location we know. When installing we need +# to give Cabal a real path, though. +htmldir_configure = $$topdir/doc/libraries/$$pkgid +htmldir_install = $(prefix)/doc/libraries/$$pkgid +else +# On non-Windows we can just give absolute paths all the time, and +# thus obey the htmldir that we are given. +htmldir_configure = $(htmldir)/libraries/$$pkgid +htmldir_install = $(htmldir_configure) +endif + ifneq "$(DOING_BIN_DIST)" "YES" CONFIGURE_OPTS = @@ -193,16 +209,6 @@ configure: $(foreach SUBDIR,$(SUBDIRS), \ # "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)',\ @@ -216,10 +222,15 @@ stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).%: %/setup/Setup ( cd $* && setup/Setup configure \ $(CONFIGURE_OPTS) \ --prefix='$$topdir' \ + --bindir='$(bindir)' \ + --libdir='$(libdir)' \ + --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 \ @@ -282,7 +293,7 @@ clean: $(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR)) $(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 $(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR)): \ clean.library.%: @@ -296,17 +307,15 @@ endif .PHONY: install install-docs install.library.% -libraryhtmldir = $(htmldir)/libraries - install: $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)) ifeq "$(HADDOCK_DOCS)" "YES" - $(INSTALL_DIR) $(DESTDIR)$(libraryhtmldir) - $(INSTALL_DATA) index.html doc-index.html $(DESTDIR)$(libraryhtmldir) - $(INSTALL_SCRIPT) gen_contents_index $(DESTDIR)$(libraryhtmldir) + $(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)$(libraryhtmldir)/base/*.css $(DESTDIR)$(libraryhtmldir) - $(INSTALL_DATA) $(DESTDIR)$(libraryhtmldir)/base/*.js $(DESTDIR)$(libraryhtmldir) - $(INSTALL_DATA) $(DESTDIR)$(libraryhtmldir)/base/*.gif $(DESTDIR)$(libraryhtmldir) + $(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 @@ -316,11 +325,18 @@ install-docs: # Ideally this would depend on a stamp/build.library.%, but if it does # then we can't change the libraries and then just rerun make. # Thus if you install without building then it will just break. + +# 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)" "$(datadir)" "$(libraryhtmldir)/$*" "$(libraryhtmldir)" "$(GHC_PKG_PROG)" "$(DESTDIR)$(libdir)/package.conf" ; \ + ../installPackage/installPackage '$(DESTDIR)' '$(prefix)' '$(bindir)' '$(libdir)' '$(libexecdir)' '$(datadir)' '$(docdir)' '$(htmldir_install)' '$(htmldir_configure)' '$(GHC_PKG_PROG)' '$(DESTDIR)$(libdir)/package.conf' ; \ fi .PHONY: binary-dist binary-dist.library.% @@ -336,7 +352,7 @@ binary-dist: $(foreach SUBDIR,$(SUBDIRS),binary-dist.library.$(SUBDIR)) 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)