summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorAaron Schrab <aaron@schrab.com>2013-02-18 10:35:07 -0500
committerFrank Terbeck <ft@bewatermyfriend.org>2013-04-03 22:10:17 +0200
commit07478c6bc3a6fae465a5555ca12b22dc607dae31 (patch)
treeff09638334f1b190a93efe92b26aaa0063a999c0 /Src
parentb6f704a642a4213d3430fc4e33a1dd4901a0b993 (diff)
downloadzsh-07478c6bc3a6fae465a5555ca12b22dc607dae31.tar.gz
zsh-07478c6bc3a6fae465a5555ca12b22dc607dae31.tar.xz
zsh-07478c6bc3a6fae465a5555ca12b22dc607dae31.zip
Generate patch level using `git describe`
Generate the patch level using `git describe` rather than relying on the
CVS $Revision$.  Need to use the `--tags` option, since currently there
are no annotated tags.  The `--long` option should be used so that the
output will always be in the 'tag-commits-hash' format rather than just
naming a tag when that would fully describe the current commit.

Since changes to the patchlevel could now be caused by changes to any
file, force the rule to be called every time that `make` is run.  Only
update the file when there are actually changes to prevent unnecessary
rebuilding of other build products (currently just `params.o` and
`zsh`).
Diffstat (limited to 'Src')
-rw-r--r--Src/zsh.mdd8
1 files changed, 4 insertions, 4 deletions
diff --git a/Src/zsh.mdd b/Src/zsh.mdd
index 6e9077676..420e8fc1d 100644
--- a/Src/zsh.mdd
+++ b/Src/zsh.mdd
@@ -39,10 +39,10 @@ params.o: patchlevel.h
 version.h: $(sdir_top)/Config/version.mk zshcurses.h zshterm.h
 	echo '#define ZSH_VERSION "'$(VERSION)'"' > $@
 
-patchlevel.h: $(sdir_top)/ChangeLog
-	sed -ne \
-	's/^\* *\$$''Revision: \(.*\) ''\$$/#define ZSH_PATCHLEVEL "\1"/p' \
-	$(sdir_top)/ChangeLog >patchlevel.h
+patchlevel.h: FORCE
+	echo '#define ZSH_PATCHLEVEL "'`git describe --tags --long`'"' > $@.tmp
+	cmp $@ $@.tmp && rm -f $@.tmp || mv $@.tmp $@
+FORCE:
 
 zshcurses.h: ../config.h
 	@if test x$(ZSH_CURSES_H) != x; then \