summaryrefslogtreecommitdiff
path: root/ghc.mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-11-03 13:33:22 +0000
committerIan Lynagh <igloo@earth.li>2009-11-03 13:33:22 +0000
commite542d75c0a4b529aeafc0fc51038d670a8adc74c (patch)
tree71e0437f883ebe1d83d1a30d20bee4a5fa11594c /ghc.mk
parent03bf7b49daf1778346ecde84eca30945a079e8ae (diff)
downloadhaskell-e542d75c0a4b529aeafc0fc51038d670a8adc74c.tar.gz
Refactor package installation
There is now less makefile code duplication. Also, stage2 packages are registered after GHC, which is important as they might depend on the ghc package (as dph now does).
Diffstat (limited to 'ghc.mk')
-rw-r--r--ghc.mk26
1 files changed, 17 insertions, 9 deletions
diff --git a/ghc.mk b/ghc.mk
index 9e1026e00a..d23f25489c 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -816,6 +816,21 @@ endif
INSTALLED_PACKAGES = $(filter-out haskeline mtl terminfo,$(PACKAGES))
HIDDEN_PACKAGES = binary
+define set_INSTALL_DISTDIR
+# $1 = libraries/base, $2 = dist-install
+# =>
+# INSTALL_DISTDIR_libraries/base = dist-install
+INSTALL_DISTDIR_$1 = $2
+endef
+
+$(eval $(foreach p,$(INSTALLED_PACKAGES) $(PACKAGES_STAGE2),\
+$(call set_INSTALL_DISTDIR,libraries/$p,dist-install)))
+INSTALL_DISTDIR_compiler = stage2
+
+ALL_INSTALLED_PACKAGES = $(addprefix libraries/,$(INSTALLED_PACKAGES)) \
+ compiler \
+ $(addprefix libraries/,$(PACKAGES_STAGE2))
+
install_packages: install_libexecs
install_packages: libffi/package.conf.install rts/package.conf.install
$(INSTALL_DIR) $(DESTDIR)$(topdir)
@@ -823,24 +838,17 @@ install_packages: libffi/package.conf.install rts/package.conf.install
$(INSTALL_DIR) $(INSTALLED_PACKAGE_CONF)
"$(INSTALLED_GHC_PKG_REAL)" --force --global-conf $(INSTALLED_PACKAGE_CONF) update libffi/package.conf.install
"$(INSTALLED_GHC_PKG_REAL)" --force --global-conf $(INSTALLED_PACKAGE_CONF) update rts/package.conf.install
- $(foreach p, $(INSTALLED_PACKAGES) $(PACKAGES_STAGE2),\
+ $(foreach p, $(ALL_INSTALLED_PACKAGES),\
"$(GHC_CABAL_INPLACE)" install \
$(INSTALLED_GHC_REAL) \
$(INSTALLED_GHC_PKG_REAL) \
$(DESTDIR)$(topdir) \
- libraries/$p dist-install \
+ $p $(INSTALL_DISTDIR_$p) \
'$(DESTDIR)' '$(prefix)' '$(ghclibdir)' '$(docdir)/html/libraries' \
$(RelocatableBuild) &&) true
$(foreach p, $(HIDDEN_PACKAGES),\
$(INSTALLED_GHC_PKG_REAL) --global-conf $(INSTALLED_PACKAGE_CONF) \
hide $p &&) true
- "$(GHC_CABAL_INPLACE)" install \
- $(INSTALLED_GHC_REAL) \
- $(INSTALLED_GHC_PKG_REAL) \
- $(DESTDIR)$(topdir) \
- compiler stage2 \
- '$(DESTDIR)' '$(prefix)' '$(ghclibdir)' '$(docdir)/html/libraries' \
- $(RelocatableBuild)
# -----------------------------------------------------------------------------
# Binary distributions