Commit 056997a2 authored by ian@well-typed.com's avatar ian@well-typed.com

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
parent 638ba3e8
......@@ -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
......
......@@ -40,7 +40,10 @@ $1_$2_HADDOCK_FLAGS += --source-module=src/%{MODULE/./-}.html --source-entity=sr
endif
ifneq "$$(BINDIST)" "YES"
$$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_FILE) : $$(INPLACE_BIN)/haddock$$(exeext) $$(GHC_CABAL_INPLACE) $$($1_$2_HS_SRCS) $$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_DEPS) | $$$$(dir $$$$@)/.
# We need the quadruple dollars for the dependencies, as it isn't
# guaranteed that we are processing the packages in dependency order,
# so we don't want to expand it yet.
$$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_FILE) : $$(INPLACE_BIN)/haddock$$(exeext) $$(GHC_CABAL_INPLACE) $$($1_$2_HS_SRCS) $$$$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_DEPS) | $$$$(dir $$$$@)/.
ifeq "$$(HSCOLOUR_SRCS)" "YES"
"$$(GHC_CABAL_INPLACE)" hscolour $2 $1
endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment