help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: wildcard all the .cc file in the subdirectories?


From: Dave Korn
Subject: RE: wildcard all the .cc file in the subdirectories?
Date: Thu, 27 Sep 2007 15:10:22 +0100

On 27 September 2007 15:01, Eli Zaretskii wrote:

>> From: "Dave Korn" <address@hidden>
>> Date: Thu, 27 Sep 2007 13:25:57 +0100
>> Cc:
>> 
>>> Suppose I have a root directory, whose subdirectories could also
>>> subdirectories, etc. I want to wildcard all the .cc in the root
>>> directory, which shall give me all the path of all the .cc files.
>>> Would you please let me know how to do it?
>> 
>>   Is this what you're looking for?
>> 
>> DIR:=/path/to/whereever
>> CC_FILES_IN_ROOT:=$(wildcard $(DIR)/*.cc)
> 
> No, I think he wants the files in subdirectories as well, and then in
> subdirectories of those subdirectories, etc., recursively.

  Ah, I misunderstood the use of "root directory" in "all the .cc in the root
directory", but in that case AFAIK the only way to do it would be

DIR:=/path/to/whereever
CC_FILES_IN_ROOT:=$(shell find $(DIR) -type f -name '*.cc')

(Well, you could actually get horribly tricky with recursive functions adding
successive instances of '*/' to the front of a string that start of as '.cc'
and using $(wildcard) on that, but it's probably not worth the trouble).

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....





reply via email to

[Prev in Thread] Current Thread [Next in Thread]