aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorXiretza <xiretza@xiretza.xyz>2020-01-29 19:05:23 +0100
committerXiretza <xiretza@xiretza.xyz>2020-03-12 19:26:21 +0100
commit9dedac50e220d28d96a456b75af61dace18fd7f6 (patch)
tree154f7de99e934e6da2014895ae6c80ab9eedfae3 /Makefile
parenta0cc795e85541b0326b6d4396a726142f0d0f8bb (diff)
downloadyosys-9dedac50e220d28d96a456b75af61dace18fd7f6.tar.gz
yosys-9dedac50e220d28d96a456b75af61dace18fd7f6.tar.bz2
yosys-9dedac50e220d28d96a456b75af61dace18fd7f6.zip
Improve ABC repository management in Makefile
`rev-parse --short` output may have a different abbreviated hash length than ABCREV, so a simple string comparison always fails, even if the correct commit is checked out. Pass both commits through rev-parse and then compare the full hashes instead. Add an `echo-abc-rev` target so that packaging scripts can set ABCPULL=0 and handle all the git nastiness themselves.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c6ecc9723..49ab780d5 100644
--- a/Makefile
+++ b/Makefile
@@ -669,7 +669,8 @@ ifneq ($(ABCREV),default)
$(Q) if ( cd abc 2> /dev/null && ! git diff-index --quiet HEAD; ); then \
echo 'REEBE: NOP pbagnvaf ybpny zbqvsvpngvbaf! Frg NOPERI=qrsnhyg va Lbflf Znxrsvyr!' | tr 'A-Za-z' 'N-ZA-Mn-za-m'; false; \
fi
- $(Q) if test "`cd abc 2> /dev/null && git rev-parse --short HEAD`" != "$(ABCREV)"; then \
+# set a variable so the test fails if git fails to run - when comparing outputs directly, empty string would match empty string
+ $(Q) if ! (cd abc && rev="`git rev-parse $(ABCREV)`" && test "`git rev-parse HEAD`" == "$$rev"); then \
test $(ABCPULL) -ne 0 || { echo 'REEBE: NOP abg hc gb qngr naq NOPCHYY frg gb 0 va Znxrsvyr!' | tr 'A-Za-z' 'N-ZA-Mn-za-m'; exit 1; }; \
echo "Pulling ABC from $(ABCURL):"; set -x; \
test -d abc || git clone $(ABCURL) abc; \
@@ -931,6 +932,9 @@ echo-yosys-ver:
echo-git-rev:
@echo "$(GIT_REV)"
+echo-abc-rev:
+ @echo "$(ABCREV)"
+
-include libs/*/*.d
-include frontends/*/*.d
-include passes/*/*.d