[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Getting a list of all source files in a tree
From: |
Ken Smith |
Subject: |
Re: Getting a list of all source files in a tree |
Date: |
Thu, 11 Aug 2005 23:00:04 -0400 |
User-agent: |
Mutt/1.5.9i |
On Thu, Aug 11, 2005 at 11:54:46PM +0300, Angel Tsankov wrote:
> Is it possible to get a list of all cpp files in a folder (including
> subfolders) using wildcard functions only?
Using wildcard alone, this can only be done using Paul's suggestion.
However, you could define a function and recurse on it. It is much more
efficient than $(shell)ing to find. It violates your original
constraint by strip, eval, addsuffix, if, and call ;)
find = \
$(strip \
$(eval these-files := $(wildcard $(addsuffix /*,$(strip $(1))))) \
$(these-files) \
$(if $(strip $(these-files)),$(call find,$(these-files))) \
)
This gets you everything. You can $(filter %.cpp,$(call find,dir)) to
make this more specific or define another function which does that for
you or modify the find function to deal with file suffixes or ...
Ken