From 07478c6bc3a6fae465a5555ca12b22dc607dae31 Mon Sep 17 00:00:00 2001 From: Aaron Schrab Date: Mon, 18 Feb 2013 10:35:07 -0500 Subject: 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`). --- Src/zsh.mdd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Src') 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 \ -- cgit 1.4.1