Only rebuild when GitVersion has actually changed

master
Geoffrey Merck 4 years ago
parent 31a1bd559b
commit a4076311f7

@ -51,11 +51,17 @@ removehostfiles :
/bin/rm -f $(CFGDIR)/DExtra_Hosts.txt /bin/rm -f $(CFGDIR)/DExtra_Hosts.txt
/bin/rm -f $(CFGDIR)/DCS_Hosts.txt /bin/rm -f $(CFGDIR)/DCS_Hosts.txt
GitVersion.h : FORCE GitVersion.h : FORCE
ifneq ("$(wildcard .git/index)","") ifneq ("$(wildcard .git/index)","")
echo "#pragma once\nconst char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ @echo "#pragma once\nconst char *gitversion = \"$(shell git rev-parse HEAD)\";" > /tmp/$@
else else
echo "#pragma once\nconst char *gitversion = \"0000000000000000000000000000000000000000\";" > $@ @echo "#pragma once\nconst char *gitversion = \"0000000000000000000000000000000000000000\";" > /tmp/$@
endif endif
@cmp -s /tmp/$@ $@; \
RETVAL=$$?; \
if [ $$RETVAL -ne 0 ]; then \
echo "Git version has changed"; \
cp -f /tmp/$@ $@; \
fi;
FORCE: FORCE:
Loading…
Cancel
Save

Powered by TurnKey Linux.