aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatherine <whitequark@whitequark.org>2023-02-23 01:38:14 +0000
committerCatherine <whitequark@whitequark.org>2023-03-01 21:17:19 +0000
commit3f173c21807625da3c8f876396d5fd2f39b26f14 (patch)
tree59d4d0d8cdf3d8aaffbde5ab1ffa1b5fa6952204
parent0f2d226ae971dc0b8de1be4514c49fbc5cfdbea2 (diff)
downloadyosys-3f173c21807625da3c8f876396d5fd2f39b26f14.tar.gz
yosys-3f173c21807625da3c8f876396d5fd2f39b26f14.tar.bz2
yosys-3f173c21807625da3c8f876396d5fd2f39b26f14.zip
Makefile: fix GIT_REV extraction if Yosys is built as submodule.
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 44a59c8c2..0ef947583 100644
--- a/Makefile
+++ b/Makefile
@@ -149,7 +149,7 @@ YOSYS_VER := 0.26+50
# back to calling git directly.
TARBALL_GIT_REV := $(shell cat $(YOSYS_SRC)/.gitcommit)
ifeq ($(TARBALL_GIT_REV),$$Format:%h$$)
-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}')
+GIT_REV := $(shell GIT_DIR=$(YOSYS_SRC)/.git git rev-parse --short=9 HEAD || echo UNKNOWN)
else
GIT_REV := $(TARBALL_GIT_REV)
endif