Commit 37d98767 authored by Nils Philippsen's avatar Nils Philippsen
Browse files

app: define GIMP_GIT_LAST_COMMIT_{TIMESTAMP,YEAR} macros

parent eed3b054
......@@ -268,10 +268,21 @@ dist-hook: dist-check-gimp-console dist-dump-gimprc
# in which case the git-version.h we ship is correct.
git-version.h: update-git-version-header
@if test -d "$(top_srcdir)/.git"; then \
echo "#define GIMP_GIT_VERSION \"`git describe`\"" > "$@.tmp"; \
git_version="`git describe`"; \
git_last_commit_timestamp="`git log -n1 --reverse --pretty=%ct`"; \
git_last_commit_year="`date --utc -d \"1970-01-01 + $$git_last_commit_timestamp seconds\" '+%Y'`"; \
elif test ! -f "$@"; then \
echo "#define GIMP_GIT_VERSION \"Unknown, shouldn't happen\"" > "$@.tmp"; \
fi
git_version="Unknown, shouldn't happen"; \
git_last_commit_timestamp=-1; \
git_last_commit_year="`date --utc '+%Y'`"; \
fi; \
echo "#ifndef __GIT_VERSION_H__" > "$@.tmp"; \
echo "#define __GIT_VERSION_H__" >> "$@.tmp"; \
echo "#include <time.h>" >> "$@.tmp"; \
echo "#define GIMP_GIT_VERSION \"$$git_version\"" >> "$@.tmp"; \
echo "#define GIMP_GIT_LAST_COMMIT_TIMESTAMP ((time_t)$$git_last_commit_timestamp)" >> "$@.tmp"; \
echo "#define GIMP_GIT_LAST_COMMIT_YEAR \"$$git_last_commit_year\"" >> "$@.tmp"; \
echo "#endif /* __GIT_VERSION_H__ */" >> "$@.tmp"
@if ( test -f "$@.tmp" && test -f "$@" && cmp "$@.tmp" "$@" > /dev/null ); then \
rm -f "$@.tmp"; \
elif test -f "$@.tmp"; then \
......
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