Commit 7dd4c12c authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

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.
parent 65cae368
......@@ -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)
......
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