Commit 7654c0db authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Only update the git_branch.h and git_hash.h files when the contents change.

This reduces the number of unnecessary recompiles of ver.cpp -> ver.o.
parent b49632aa
Pipeline #1027 passed with stage
in 16 minutes and 21 seconds
......@@ -121,10 +121,14 @@ FORCE:
ifneq ($(GIT), NO)
git_hash.h: FORCE ../../.git
echo '#define GIT_HASH "'`git log -1 HEAD --format=%h`\" > $@
$(QUIET)echo '#define GIT_HASH "'`git log -1 HEAD --format=%h`\" > $@.tmp
$(QUIET)diff $@.tmp $@ || cp $@.tmp $@
$(QUIET)rm -f $@.tmp
git_branch.h: FORCE ../../.git
echo '#define GIT_BRANCH "'`git rev-parse --abbrev-ref HEAD`\" > $@
$(QUIET)echo '#define GIT_BRANCH "'`git rev-parse --abbrev-ref HEAD`\" > $@.tmp
$(QUIET)diff $@.tmp $@ || cp $@.tmp $@
$(QUIET)rm -f $@.tmp
ifeq ($(os),linux)
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