common.mk: Consider possibility that not building inside a git checkout
This commit is contained in:
parent
71a2eb7b85
commit
e12077513f
1 changed files with 4 additions and 1 deletions
|
@ -131,7 +131,10 @@ else
|
|||
LDFLAGS += -g -O2
|
||||
endif
|
||||
|
||||
GITSHORTREV=\"$(shell cd $(ROOT); git rev-parse --short -q HEAD)\"
|
||||
GITSHORTREV=\"$(shell cd $(ROOT); git rev-parse --short -q HEAD 2> /dev/null)\"
|
||||
ifeq ($(GITSHORTREV),\"\")
|
||||
GITSHORTREV="\"(nogit)\"" # (same length as a short git hash)
|
||||
endif
|
||||
CPPFLAGS += -DGITSHORTREV=$(GITSHORTREV)
|
||||
|
||||
ifeq ($(OTA),0)
|
||||
|
|
Loading…
Reference in a new issue