Change way to get commit sha
authorJannis Harder <me@jix.one>
Mon, 23 May 2022 15:04:07 +0000 (17:04 +0200)
committerMiodrag Milanovic <mmicko@gmail.com>
Mon, 23 May 2022 15:07:17 +0000 (17:07 +0200)
Makefile

index 6d901956fe7e02931542bb231fd4aaef155b689e..7235c9dc3b44cb60c0cce1cfbdaf6663de304b18 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -130,7 +130,7 @@ LDLIBS += -lrt
 endif
 
 YOSYS_VER := 0.17+33
-GIT_REV := $(shell git -C $(YOSYS_SRC) rev-parse --short HEAD 2> /dev/null || echo UNKNOWN)
+GIT_REV := $(shell git ls-remote $(YOSYS_SRC) HEAD -q | $(AWK) 'BEGIN {R = "UNKNOWN"}; ($$2 == "HEAD") {R = substr($$1, 1, 9); exit} END {print R}')
 OBJS = kernel/version_$(GIT_REV).o
 
 bumpversion: