summaryrefslogtreecommitdiff
path: root/ghc.mk
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2014-11-28 10:57:18 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2014-11-28 11:04:01 +0100
commit7dd4c12c608ba7b42e6e453f4db825655716f01d (patch)
tree832a2fc1a5b528f3745cc25ad6bd9b29621e9473 /ghc.mk
parent65cae368e2e5fdc537f616ff98a5cffc2e6071e3 (diff)
downloadhaskell-7dd4c12c608ba7b42e6e453f4db825655716f01d.tar.gz
Improve VERSION/GIT_COMMIT_ID handling for sdist
This makes `VERSION` updating a bit more robust (the file gets only updated if its content would actually change), as well as moving the dependency of `VERSION` and `GIT_COMMIT_ID` to the `sdist-ghc-prep` target, as that's where it's actually needed. This fixes the specialised target `make sdist-ghc` not properly creating/updating the `VERSION` and `GIT_COMMIT_ID` files before creating the ghc source-dist tarball, as well as avoiding stale `VERSION` files.
Diffstat (limited to 'ghc.mk')
-rw-r--r--ghc.mk9
1 files changed, 6 insertions, 3 deletions
diff --git a/ghc.mk b/ghc.mk
index c47104d2ab..2c9c6359a8 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -1112,8 +1112,11 @@ SRC_DIST_GHC_FILES += \
settings.in VERSION GIT_COMMIT_ID \
boot packages ghc.mk
-VERSION :
- echo $(ProjectVersion) >VERSION
+.PHONY: VERSION
+VERSION:
+ @if test -f $@ && test "`cat $@`" = "$(ProjectVersion)"; \
+ then echo "$@ needs no update"; \
+ else echo "update $@ ($(ProjectVersion))"; echo "$(ProjectVersion)" > $@; fi
.PHONY: GIT_COMMIT_ID
GIT_COMMIT_ID:
@@ -1129,7 +1132,7 @@ GIT_COMMIT_ID:
then echo "$@ needs no update"; \
else echo "update $@ ($(ProjectGitCommitId))"; echo -n "$(ProjectGitCommitId)" > $@; fi
-sdist : VERSION GIT_COMMIT_ID
+sdist-ghc-prep : VERSION GIT_COMMIT_ID
# Use:
# $(call sdist_ghc_file,compiler,stage2,cmm,Foo/Bar,CmmLex,x)