diff --git a/app/Makefile.am b/app/Makefile.am index 6a6648ddc2..2cbdef2fa8 100644 --- a/app/Makefile.am +++ b/app/Makefile.am @@ -279,13 +279,13 @@ git-version.h: update-git-version-header 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 " >> "$@.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 -n "$$git_version"; then \ + echo "#ifndef __GIT_VERSION_H__" > "$@.tmp"; \ + echo "#define __GIT_VERSION_H__" >> "$@.tmp"; \ + echo "#define GIMP_GIT_VERSION \"$$git_version\"" >> "$@.tmp"; \ + echo "#define GIMP_GIT_LAST_COMMIT_YEAR \"$$git_last_commit_year\"" >> "$@.tmp"; \ + echo "#endif /* __GIT_VERSION_H__ */" >> "$@.tmp"; \ + fi @if ( test -f "$@.tmp" && test -f "$@" && cmp "$@.tmp" "$@" > /dev/null ); then \ rm -f "$@.tmp"; \ elif test -f "$@.tmp"; then \