summaryrefslogtreecommitdiff
path: root/ghc.mk
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-02-09 11:06:13 +0100
committerBen Gamari <ben@smart-cactus.org>2016-02-09 11:06:24 +0100
commit04fb7813ab489b1d70a73351836950825b2ce4f7 (patch)
treeb2dc315e19d7f1091302b85f8dc991a851978fd4 /ghc.mk
parent4ec61411930495fc109be27993c176fd7aaf486d (diff)
downloadhaskell-04fb7813ab489b1d70a73351836950825b2ce4f7.tar.gz
Early error when crosscompiling + haddock/docs
When CrossCompiling=YES or Stage1Only=YES, building the haddocks and the User's Guide should be skipped, because haddock and mkUserGuidePart depend on the GHC API. See Note [No stage2 packages when CrossCompiling or Stage1Only] for details. There are several places in the build system where the variables HADDOCK_DOCS and BUILD_SPHINX_* are checked. Instead of also checking for the variables CrossCompiling or Stage1Only in all those places, `make` will now exit with a nice error message when the user requests the impossible. Reviewers: rwbarton, austin, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D1882
Diffstat (limited to 'ghc.mk')
-rw-r--r--ghc.mk23
1 files changed, 19 insertions, 4 deletions
diff --git a/ghc.mk b/ghc.mk
index 8257cf0337..8f4aaba491 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -195,6 +195,24 @@ $(error HSCOLOUR_SRCS=YES, but HSCOLOUR_CMD is empty. \
endif
endif
+ifeq "$(HADDOCK_DOCS)" "YES"
+ifneq "$(CrossCompiling) $(Stage1Only)" "NO NO"
+$(error Can not build haddock docs when CrossCompiling or Stage1Only. \
+ Set HADDOCK_DOCS=NO in your mk/build.mk file. \
+ See Note [No stage2 packages when CrossCompiling or Stage1Only])
+endif
+endif
+
+ifneq "$(BUILD_SPHINX_HTML) $(BUILD_SPHINX_PDF)" "NO NO"
+# The User's Guide requires mkUserGuidePart, which uses the GHC API.
+ifneq "$(CrossCompiling) $(Stage1Only)" "NO NO"
+$(error Can not build User's Guide when CrossCompiling or Stage1Only. \
+ Set BUILD_SPHINX_HTML=NO, BUILD_SPHINX_PDF=NO in your \
+ mk/build.mk file. \
+ See Note [No stage2 packages when CrossCompiling or Stage1Only])
+endif
+endif
+
endif # CLEANING
# -----------------------------------------------------------------------------
@@ -691,7 +709,7 @@ ifeq "$(HADDOCK_DOCS)" "NO"
BUILD_DIRS := $(filter-out utils/haddock,$(BUILD_DIRS))
BUILD_DIRS := $(filter-out utils/haddock/doc,$(BUILD_DIRS))
endif
-ifeq "$(BUILD_SPHINX_HTML) $(BUILD_SPHINX_PDF)" "NO NO NO"
+ifeq "$(BUILD_SPHINX_HTML) $(BUILD_SPHINX_PDF)" "NO NO"
# Don't to build this little utility if we're not building the User's Guide.
BUILD_DIRS := $(filter-out utils/mkUserGuidePart,$(BUILD_DIRS))
endif
@@ -711,11 +729,8 @@ endif
ifneq "$(CrossCompiling) $(Stage1Only)" "NO NO"
# See Note [No stage2 packages when CrossCompiling or Stage1Only].
# See Note [Stage1Only vs stage=1] in mk/config.mk.in.
-BUILD_DIRS := $(filter-out utils/haddock,$(BUILD_DIRS))
-BUILD_DIRS := $(filter-out utils/haddock/doc,$(BUILD_DIRS))
BUILD_DIRS := $(filter-out utils/ghctags,$(BUILD_DIRS))
BUILD_DIRS := $(filter-out utils/check-api-annotations,$(BUILD_DIRS))
-BUILD_DIRS := $(filter-out utils/mkUserGuidePart,$(BUILD_DIRS))
endif
endif # CLEANING