Commit 04fb7813 authored by thomie's avatar thomie Committed by Ben Gamari

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
parent 4ec61411
......@@ -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
......
......@@ -6,7 +6,6 @@ BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
......
......@@ -6,6 +6,5 @@ BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
......@@ -6,6 +6,5 @@ BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
......@@ -6,7 +6,6 @@ BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
......
......@@ -6,7 +6,6 @@ BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
......
......@@ -6,7 +6,6 @@ BUILD_PROF_LIBS = YES
#SplitObjs
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
......
......@@ -6,5 +6,4 @@ BUILD_PROF_LIBS = YES
#SplitObjs
#HADDOCK_DOCS
#BUILD_SPHINX_HTML
#BUILD_SPHINX_PS
#BUILD_SPHINX_PDF
......@@ -6,5 +6,4 @@ BUILD_PROF_LIBS = YES
#SplitObjs
#HADDOCK_DOCS
#BUILD_SPHINX_HTML
#BUILD_SPHINX_PS
#BUILD_SPHINX_PDF
......@@ -6,7 +6,6 @@ BUILD_PROF_LIBS = YES
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
......
......@@ -6,7 +6,6 @@ BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
......
......@@ -6,6 +6,5 @@ BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
......@@ -6,6 +6,5 @@ BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
......@@ -6,6 +6,5 @@ BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
......@@ -7,7 +7,6 @@ BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = YES
BUILD_SPHINX_HTML = YES
BUILD_SPHINX_PS = NO
BUILD_SPHINX_PDF = NO
ifeq "$(ValidateHpc)" "YES"
......
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