diff options
author | John Hood <cgull@glup.org> | 2015-06-09 22:00:42 -0400 |
---|---|---|
committer | John Hood <cgull@glup.org> | 2015-06-11 00:39:55 -0400 |
commit | 39c8b04c9725170b09e9316dac631a2a1e302b70 (patch) | |
tree | 6fde6934f81e026aee4ac2e8fda9f300329bf6e8 /Makefile.am | |
parent | c58642dd63b8d359a44bdf1197df7b8405e25d94 (diff) |
Makefile.am: fixup version file generation
Signed-off-by: John Hood <cgull@glup.org>
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am index 1d7b297..ba19344 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,17 +8,20 @@ CLANG_SCAN_BUILD = scan-build .PHONY: VERSION VERSION: - @-[ -f VERSION ] || echo @PACKAGE_STRING@ > VERSION - @-git status > /dev/null 2>&1 && \ - git describe --dirty > VERSION.new && \ - ! diff -q VERSION VERSION.new > /dev/null && \ - mv VERSION.new VERSION + @set -e; if [ ! -f VERSION ]; then echo @PACKAGE_STRING@ > VERSION; fi + @set -e; if git status > /dev/null 2>&1; then \ + git describe --dirty > VERSION.new; \ + if ! diff -q VERSION VERSION.new > /dev/null 2>&1; then \ + mv -f VERSION.new VERSION; \ + fi; \ + fi @rm -f VERSION.new version.h: VERSION @printf '#define BUILD_VERSION "%s"\n' "$$(cat VERSION)" > version.h.new - @-! diff -q version.h version.h.new > /dev/null && \ - mv version.h.new version.h + @set -e; if ! diff -q version.h version.h.new > /dev/null 2>&1; then \ + mv -f version.h.new version.h; \ + fi @rm -f version.h.new clean-local: |