[PATCH 3/3] Makefile.local: use $(wildcard) to check existence of ${srcdir}/.git

Tomi Ollila tomi.ollila at iki.fi
Wed May 25 14:04:32 PDT 2016


With this GNU Make construct one shell invocation can be skipped
and code looks shorter (narrower). This would now match to .git
being other file type than regular file or directory (or symlink
to those), but that is not a use case anyone should expect users
to do.
---
 Makefile.local | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.local b/Makefile.local
index ee3cf18f5757..045549b54442 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -10,7 +10,7 @@
 # repository), we let git append identification of the actual commit.
 PACKAGE=notmuch
 
-IS_GIT:=$(shell if [ -d ${srcdir}/.git -o -f ${srcdir}/.git ] ; then echo yes ; else echo no; fi)
+IS_GIT:=$(if $(wildcard ${srcdir}/.git),yes,no)
 
 ifeq ($(IS_GIT),yes)
 DATE:=$(shell git --git-dir=${srcdir}/.git log --date=short -1 --pretty=format:%cd)
-- 
2.8.2



More information about the notmuch mailing list