summaryrefslogtreecommitdiff
path: root/ghc.mk
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-09-27 15:22:37 -0400
committerBen Gamari <ben@smart-cactus.org>2017-09-27 17:37:29 -0400
commit1e9f90af7311c33de0f7f5b7dba594725596d675 (patch)
tree705865c81d93f3084934825917eadb4e42296fac /ghc.mk
parent4364f1e7543b6803cfaef321105d253e0bdf08a4 (diff)
downloadhaskell-1e9f90af7311c33de0f7f5b7dba594725596d675.tar.gz
Move check-ppr and check-api-annotations to testsuite/utils
These are needed by the testsuite and consequently must be shipped in the testsuite tarball to ensure that we can test binary distributions. See #13897. Test Plan: Validate Reviewers: austin Subscribers: snowleopard, rwbarton, thomie GHC Trac Issues: #13897 Differential Revision: https://phabricator.haskell.org/D4039
Diffstat (limited to 'ghc.mk')
-rw-r--r--ghc.mk34
1 files changed, 28 insertions, 6 deletions
diff --git a/ghc.mk b/ghc.mk
index 8918441b83..c3edc5eb1a 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -560,8 +560,8 @@ ghc/stage2/package-data.mk: compiler/stage2/package-data.mk
# all the other libraries' package-data.mk files.
utils/haddock/dist/package-data.mk: compiler/stage2/package-data.mk
utils/ghctags/dist-install/package-data.mk: compiler/stage2/package-data.mk
-utils/check-api-annotations/dist-install/package-data.mk: compiler/stage2/package-data.mk
-utils/check-ppr/dist-install/package-data.mk: compiler/stage2/package-data.mk
+testsuite/utils/check-api-annotations/dist-install/package-data.mk: compiler/stage2/package-data.mk
+testsuite/utils/check-ppr/dist-install/package-data.mk: compiler/stage2/package-data.mk
# add the final package.conf dependency: ghc-prim depends on RTS
libraries/ghc-prim/dist-install/package-data.mk : rts/dist/package.conf.inplace
@@ -684,8 +684,6 @@ BUILD_DIRS += utils/hsc2hs
BUILD_DIRS += utils/ghc-pkg
BUILD_DIRS += utils/testremove
BUILD_DIRS += utils/ghctags
-BUILD_DIRS += utils/check-api-annotations
-BUILD_DIRS += utils/check-ppr
BUILD_DIRS += utils/ghc-cabal
BUILD_DIRS += utils/hpc
BUILD_DIRS += utils/runghc
@@ -695,6 +693,19 @@ BUILD_DIRS += utils/count_lines
BUILD_DIRS += utils/compare_sizes
BUILD_DIRS += iserv
+# If we are in a tree derived from a source tarball the testsuite/ directory may
+# not exist, meaning we can't build the testsuite/utils packages.
+ifeq "$(wildcard testsuite/Makefile)" ""
+HaveTestsuite = NO
+else
+HaveTestsuite = YES
+endif
+
+ifeq "$(HaveTestsuite)" "YES"
+BUILD_DIRS += testsuite/utils/check-api-annotations
+BUILD_DIRS += testsuite/utils/check-ppr
+endif
+
# ----------------------------------------------
# Actually include the sub-ghc.mk's
@@ -734,8 +745,8 @@ 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/ghctags,$(BUILD_DIRS))
-BUILD_DIRS := $(filter-out utils/check-api-annotations,$(BUILD_DIRS))
-BUILD_DIRS := $(filter-out utils/check-ppr,$(BUILD_DIRS))
+BUILD_DIRS := $(filter-out testsuite/utils/check-api-annotations,$(BUILD_DIRS))
+BUILD_DIRS := $(filter-out testsuite/utils/check-ppr,$(BUILD_DIRS))
endif
endif # CLEANING
@@ -1572,3 +1583,14 @@ phase_0_builds: $(utils/deriveConstants_dist_depfile_c_asm)
.PHONY: phase_1_builds
phase_1_builds: $(PACKAGE_DATA_MKS)
+
+# Various utilities in testsuite/utils which must be built before
+# the testsuite is run.
+.PHONY: testsuite_utils
+testsuite_utils:
+ifeq "$(HaveTestsuite)" "NO"
+ @echo "The testsuite/ directory appears to be unavailable."
+ @echo ""
+ @echo "If this tree is from a source tarball please download and extract"
+ @echo "the corresponding testsuite tarball."
+endif