]> git.cworth.org Git - notmuch/commitdiff
Makefile.local: use $(wildcard) to check existence of ${srcdir}/.git
authorTomi Ollila <tomi.ollila@iki.fi>
Wed, 25 May 2016 21:04:32 +0000 (00:04 +0300)
committerDavid Bremner <david@tethera.net>
Sun, 4 Sep 2016 11:14:55 +0000 (08:14 -0300)
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

index 200419472084177f944476cbf8e487b9526e978d..5587cd2c29a635c004df1b1885409905a4b85b60 100644 (file)
@@ -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)