summaryrefslogtreecommitdiff
path: root/compiler/ghc.mk
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-05-15 11:11:09 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-05-15 11:11:09 +0000
commit7b45c46cbabe1288ea87bd9b94c57e010ed17e60 (patch)
treead7a51f5e757e579d4efea805dee14f2ee048e1c /compiler/ghc.mk
parentcc00752dc2fa7bd3f13624cdc1e048a423eaa845 (diff)
downloadhaskell-7b45c46cbabe1288ea87bd9b94c57e010ed17e60.tar.gz
Further fixes to the stage1 version hack; fix validate.
I'm less convinced this is a good idea now. But it does avoid rebuilding most of stage1 when you pull and reconfigure. Better solutions welcome.
Diffstat (limited to 'compiler/ghc.mk')
-rw-r--r--compiler/ghc.mk19
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 22459b5831..8ecfa7df7e 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -404,15 +404,22 @@ compiler/stage3/package-data.mk : compiler/ghc.mk
compiler_PACKAGE = ghc
+# Note [fiddle-stage1-version]
# The version of the GHC package changes every day, since the
# patchlevel is the current date. We don't want to force
# recompilation of the entire compiler when this happens, so for stage
# 1 we omit the patchlevel from the version number. For stage 2 we
# have to include the patchlevel since this is the package we install,
# however.
+#
+# Note: we also have to tweak the version number of the package itself
+# when it gets registered; see Note [munge-stage1-package-config]
+# below.
+ifneq "$(ProjectPatchLevel)" "0"
define compiler_PACKAGE_MAGIC
compiler_stage1_VERSION = $(subst .$(ProjectPatchLevel),,$(ProjectVersion))
endef
+endif
# haddocking only happens for stage2
compiler_stage1_DO_HADDOCK = NO
@@ -450,5 +457,17 @@ $(compiler_stage3_depfile) : compiler/stage3/$(PLATFORM_H)
$(compiler_stage1_depfile) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_GHCCONSTANTS) $(includes_DERIVEDCONSTANTS) $(PRIMOP_BITS)
$(compiler_stage2_depfile) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_GHCCONSTANTS) $(includes_DERIVEDCONSTANTS) $(PRIMOP_BITS)
$(compiler_stage3_depfile) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_GHCCONSTANTS) $(includes_DERIVEDCONSTANTS) $(PRIMOP_BITS)
+
+# Note [munge-stage1-package-config]
+# Strip the date/patchlevel from the version of stage1. See Note
+# [fiddle-stage1-version] above.
+ifneq "$(ProjectPatchLevel)" "0"
+compiler/stage1/inplace-pkg-config-munged: compiler/stage1/inplace-pkg-config
+ sed "s#.$(ProjectPatchLevel)##" <$< >$@
+ $(compiler_stage1_GHC_PKG) update --force $(compiler_stage1_GHC_PKG_OPTS) $@
+
+$(compiler_stage1_v_LIB) : compiler/stage1/inplace-pkg-config-munged
+endif
+
endif