Commit ab1e8ea4 authored by Mathieu Giraud's avatar Mathieu Giraud

create-git-version-h.sh: do not overwrite the .h file when the content is the same

Before this commit, vidjil.o was always recompiled.
parent de312542
#!/bin/sh
git log -1 --pretty=format:'#define GIT_VERSION "%h (%cd)"' --date=short --abbrev-commit > git-version.h 2> /dev/null
GITV_H=git-version.h
GITV_H_TMP=git-version.h.tmp
git log -1 --pretty=format:'#define GIT_VERSION "%h (%cd)"' --date=short --abbrev-commit > ${GITV_H_TMP} 2> /dev/null
# Replace the file only when the new file is different
diff ${GITV_H} ${GITV_H_TMP} || mv ${GITV_H_TMP} ${GITV_H}
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