diff --git a/Makefile.coq.local b/Makefile.coq.local
index b621e264df3447a60b7e33a4265bc28b7a634813..320d96b05c3177332858a0ec1919c472043a1dcf 100644
--- a/Makefile.coq.local
+++ b/Makefile.coq.local
@@ -8,7 +8,7 @@ test: $(TESTFILES:.v=.vo)
 .PHONY: test
 
 COQ_TEST=$(COQTOP) $(COQDEBUG) -batch -test-mode
-COQ_OLD=$(shell echo "$(COQ_VERSION)" | egrep "^8\.(7|10)\b" > /dev/null && echo 1)
+COQ_OLD=$(shell echo "$(COQ_VERSION)" | egrep "^8\.7\b" -q && echo 1)
 COQ_MINOR_VERSION=$(shell echo "$(COQ_VERSION)" | egrep '^[0-9]+\.[0-9]+\b' -o)
 
 tests/.coqdeps.d: $(TESTFILES)