Skip to content
Snippets Groups Projects
Commit 7654c0db authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
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
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1027 passed
......@@ -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
endif
ifeq ($(os),linux)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment