diff options
-rw-r--r-- | func.cc | 9 | ||||
-rw-r--r-- | testcase/wildcard.mk | 2 | ||||
-rw-r--r-- | testcase/wildcard_cache.mk | 6 | ||||
-rw-r--r-- | testcase/wildcard_multi.mk | 2 |
4 files changed, 8 insertions, 11 deletions
@@ -253,13 +253,8 @@ void JoinFunc(const vector<Value*>& args, Evaluator* ev, string* s) { void WildcardFunc(const vector<Value*>& args, Evaluator* ev, string* s) { COLLECT_STATS("func wildcard time"); shared_ptr<string> pat = args[0]->Eval(ev); - if (ev->avoid_io()) { - *s += "$(/bin/ls -d "; - *s += *pat; - *s += " 2> /dev/null)"; - return; - } - + // Note GNU make does not delay the execution of $(wildcard) so we + // do not need to check avoid_io here. WordWriter ww(s); vector<string>* files; for (StringPiece tok : WordScanner(*pat)) { diff --git a/testcase/wildcard.mk b/testcase/wildcard.mk index b739f9c..884605e 100644 --- a/testcase/wildcard.mk +++ b/testcase/wildcard.mk @@ -1,5 +1,3 @@ -# TODO(ninja): Fix - MAKEVER:=$(shell make --version | ruby -n0e 'puts $$_[/Make (\d)/,1]') files = $(wildcard M*) diff --git a/testcase/wildcard_cache.mk b/testcase/wildcard_cache.mk index e8fb12d..1c9174a 100644 --- a/testcase/wildcard_cache.mk +++ b/testcase/wildcard_cache.mk @@ -12,3 +12,9 @@ foo,bar: echo $(files) touch foo,bar echo $(files) + +$(shell mkdir dir) +$(info $(wildcard dir/not_exist)) +$(shell touch dir/file) +# This should show nothing. +$(info $(wildcard dir/file)) diff --git a/testcase/wildcard_multi.mk b/testcase/wildcard_multi.mk index 1db9377..9054ca3 100644 --- a/testcase/wildcard_multi.mk +++ b/testcase/wildcard_multi.mk @@ -1,5 +1,3 @@ -# TODO(ninja): Fix - files = $(wildcard P* M*) test1: |