makefile: Properly detect building with uncommitted changes

This commit is contained in:
Mark Pizzolato 2021-03-08 16:03:11 -08:00
parent 076c1ef094
commit 73be1953ee

View file

@ -290,10 +290,10 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin)
else
NEED_COMMIT_ID = need-commit-id
endif
ifeq (need-commit-id,$(NEED_COMMIT_ID))
ifneq (,$(shell git update-index --refresh --))
GIT_EXTRA_FILES=+uncommitted-changes
endif
ifneq (,$(shell git update-index --refresh --))
GIT_EXTRA_FILES=+uncommitted-changes
endif
ifneq (,$(or $(NEED_COMMIT_ID),$(GIT_EXTRA_FILES)))
isodate=$(shell git log -1 --pretty="%ai"|sed -e 's/ /T/'|sed -e 's/ //')
$(shell git log -1 --pretty="SIM_GIT_COMMIT_ID %H$(GIT_EXTRA_FILES)%nSIM_GIT_COMMIT_TIME $(isodate)" >.git-commit-id)
endif