summaryrefslogtreecommitdiff
path: root/ghc.mk
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-03-03 13:35:41 +0000
committerIan Lynagh <ian@well-typed.com>2013-03-03 14:20:26 +0000
commit056997a285a368f5f78905b4b325a3258484f71d (patch)
tree8c0cd58381f7f7aac7d17061dd6157aaeb359daa /ghc.mk
parent638ba3e8b74816934b29738b1dfaecb536dbcddd (diff)
downloadhaskell-056997a285a368f5f78905b4b325a3258484f71d.tar.gz
Add PACKAGES_STAGE0 to build-dirs too; fixes #7700
This is sometimes needed when cross-compiling, as some packages may be built in stage 0 but not stage 1. In order to make everything work out, this also removes the requirement that the build-dirs are in dependency order
Diffstat (limited to 'ghc.mk')
-rw-r--r--ghc.mk16
1 files changed, 8 insertions, 8 deletions
diff --git a/ghc.mk b/ghc.mk
index 191987c41d..f9f9785b7c 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -583,9 +583,6 @@ endif
# -----------------------------------------------------------------------------
# Include build instructions from all subdirs
-# These need to be in dependency order, as some of the rules refer to
-# variables defined by their dependencies
-
ifneq "$(BINDIST)" "YES"
BUILD_DIRS += utils/mkdirhier
endif
@@ -621,7 +618,15 @@ BUILD_DIRS += utils/genapply
endif
ifneq "$(CLEANING)" "YES"
+# These are deliberately in reverse order, so as to ensure that
+# there is no need to have them in dependency order. That's important
+# because it's tricky to ensure that they are in dependency order when
+# cross-compiling, as some packages may only be in PACKAGES_STAGE0
+# or PACKAGES_STAGE1.
+BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE2))
BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE1))
+BUILD_DIRS += $(patsubst %, libraries/%, $(filter-out $(PACKAGES_STAGE1),$(PACKAGES_STAGE0))
+BUILD_DIRS += libraries/dph
endif
@@ -655,11 +660,6 @@ BUILD_DIRS += $(MAYBE_HPC)
BUILD_DIRS += $(MAYBE_RUNGHC)
BUILD_DIRS += ghc
-ifneq "$(CLEANING)" "YES"
-BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE2))
-BUILD_DIRS += libraries/dph
-endif
-
ifneq "$(BINDIST)" "YES"
ifneq "$(CrossCompiling)-$(phase)" "YES-final"
BUILD_DIRS += utils/mkUserGuidePart