summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-11-30 03:32:42 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-12-01 03:12:21 -0500
commitb53f122749af4dec41e3b4fde4c4c3bfcd459982 (patch)
tree19a122fb0889d1b0275d0776bec334ec7909518c
parentdefd8d548572f04765a3f056e5d6181101528342 (diff)
downloadhaskell-b53f122749af4dec41e3b4fde4c4c3bfcd459982.tar.gz
Factor our `$dir_$distdir_PKGDATA` make variable
This makes a few things cleaner.
-rw-r--r--rules/build-package-data.mk10
-rw-r--r--rules/build-package.mk2
2 files changed, 7 insertions, 5 deletions
diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk
index b4bb84cb47..c55cb540ef 100644
--- a/rules/build-package-data.mk
+++ b/rules/build-package-data.mk
@@ -121,15 +121,17 @@ $1_$2_CONFIGURE_OPTS += --with-ar="$$(AR_STAGE$3)"
$1_$2_CONFIGURE_OPTS += $$(if $$(ALEX),--with-alex="$$(ALEX)")
$1_$2_CONFIGURE_OPTS += $$(if $$(HAPPY),--with-happy="$$(HAPPY)")
+$1_$2_PKGDATA = $1/$2/package-data.mk
+
ifneq "$$(BINDIST)" "YES"
ifneq "$$(NO_GENERATED_MAKEFILE_RULES)" "YES"
-$1/$2/inplace-pkg-config : $1/$2/package-data.mk
-$1/$2/build/$$(or $$($1_EXECUTABLE),$$($1_$2_PROGNAME),.)/autogen/cabal_macros.h : $1/$2/package-data.mk
+$1/$2/inplace-pkg-config : $$($1_$2_PKGDATA)
+$1/$2/build/$$(or $$($1_EXECUTABLE),$$($1_$2_PROGNAME),.)/autogen/cabal_macros.h : $$($1_$2_PKGDATA)
# This rule configures the package, generates the package-data.mk file
# for our build system, and registers the package for use in-place in
# the build tree.
-$1/$2/package-data.mk : $$$$(ghc-cabal_INPLACE) $$($1_$2_GHC_PKG_DEP) $1/$$($1_PACKAGE).cabal $$(wildcard $1/configure) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_CONFIG_DEP)
+$$($1_$2_PKGDATA) : $$$$(ghc-cabal_INPLACE) $$($1_$2_GHC_PKG_DEP) $1/$$($1_PACKAGE).cabal $$(wildcard $1/configure) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_CONFIG_DEP)
# Checking packages built with the bootstrapping compiler would
# generally be a waste of time. Either we will rebuild them with
# stage1/stage2, or we don't really care about them.
@@ -145,7 +147,7 @@ endif
endif # NO_GENERATED_MAKEFILE_RULES
endif # BINDIST
-PACKAGE_DATA_MKS += $1/$2/package-data.mk
+PACKAGE_DATA_MKS += $$($1_$2_PKGDATA)
$(call profEnd, build-package-data($1,$2,$3))
endef
diff --git a/rules/build-package.mk b/rules/build-package.mk
index 6701746895..12381d8892 100644
--- a/rules/build-package.mk
+++ b/rules/build-package.mk
@@ -99,7 +99,7 @@ endif
# Each Haskell compilation in this package will depend on the
# package-data.mk file because e.g. if the version of the package
# changes we need to recompile everything in it.
-$1_$2_PKGDATA_DEP = $1/$2/package-data.mk
+$1_$2_PKGDATA_DEP = $$($1_$2_PKGDATA)
endif
$(call hs-sources,$1,$2)