From: Glenn Morris <rgm@gnu.org>
Date: Fri, 4 Dec 2015 00:57:11 +0000 (-0500)
Subject: * Makefile.in: Avoid duplication.
X-Git-Tag: emacs-26.0.90~2898
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ffefb6e899fbcdcbd79cb34292d57b7bc3043fcc;p=emacs.git

* Makefile.in: Avoid duplication.

(have-tests): New rule.
(check, check-maybe): Use it.
---

diff --git a/Makefile.in b/Makefile.in
index 06e5b065701..57e29d7f983 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -921,22 +921,16 @@ extraclean: $(extraclean_dirs:=_extraclean)
 TAGS tags: lib lib-src src
 	$(MAKE) -C src tags
 
-
-check-maybe: all
+.PHONY: have-tests
+have-tests:
 	@if test ! -d test; then \
 	  echo "You do not seem to have the test/ directory."; \
 	  echo "Maybe you are using a release tarfile, rather than a repository checkout."; \
-	else \
-	  $(MAKE) -C test check-maybe; \
+	 exit 1; \
 	fi
 
-check: all
-	@if test ! -d test; then \
-	  echo "You do not seem to have the test/ directory."; \
-	  echo "Maybe you are using a release tarfile, rather than a repository checkout."; \
-	else \
-	  $(MAKE) -C test check; \
-	fi
+check check-maybe: have-tests all
+	$(MAKE) -C test $@
 
 dist:
 	cd ${srcdir}; ./make-dist