From 3f173c21807625da3c8f876396d5fd2f39b26f14 Mon Sep 17 00:00:00 2001 From: Catherine Date: Thu, 23 Feb 2023 01:38:14 +0000 Subject: Makefile: fix GIT_REV extraction if Yosys is built as submodule. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3