make/common/MakeBase.gmk
changeset 44725 8747b14eb49c
parent 44027 3a3050924db2
child 44894 e1b5a6c45d39
child 45323 52500c1d7f1f
--- a/make/common/MakeBase.gmk	Mon Apr 17 19:23:42 2017 -0700
+++ b/make/common/MakeBase.gmk	Wed Apr 19 10:24:42 2017 +0200
@@ -672,9 +672,9 @@
   # Param 1 - Dirs to find in
   # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
   define CacheFind
-      $(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \
-    $(shell $(FIND) $1 \( -type f -o -type l \) $2), \
-        $(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE)))
+    $(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \
+      $(if $(wildcard $1), $(shell $(FIND) $1 \( -type f -o -type l \) $2)), \
+      $(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE)))
   endef
 
 else