make: version -- Ensure that .gitid exist vefore read

In case if there is no .gitid file we might endup
with build error. Make sure it exist.

Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2015-05-05 14:07:33 +03:00 committed by Pavel Emelyanov
parent 1e919423a8
commit 46a0e74d5f

View file

@ -7,7 +7,7 @@ GITID := $(shell if [ -d ".git" ]; then git describe; fi)
ifeq ($(GITID),)
GITID := 0
else
GITID_FILE_VALUE := $(shell if [ `cat .gitid` = $(GITID) ]; then echo y; fi)
GITID_FILE_VALUE := $(shell if [ -f '.gitid' ]; then if [ `cat .gitid` = $(GITID) ]; then echo y; fi; fi)
ifneq ($(GITID_FILE_VALUE),y)
.PHONY: $(GITID_FILE)
endif