
On 18 September 2013 00:03, Matthew Cengia <mattcen@gmail.com> wrote:
On 2013-09-17 23:52, David wrote: [...]
After sending I realised this could work for filenames with whitespace, provided it is part of a make rule:
found_files := $(wildcard *.mkv) $(wildcard *.mp4) $(wildcard *.avi)
I'm pretty sure this is also valid:
found_files := $(wildcard *.mkv *.mp4 *.avi)
Yes! You are correct, I just tested and confirmed. Also, while various good points have been made in this thread, it's hard to be confident to give optimal assistance until the question is better defined. It would help to know the reason why a makefile is involved. It is hard to be precisely helpful and give a tested solution when the precise problem is unknown. Tricky aspects are: 1) Filename whitespace. 2) Shell glob options. 3) Makefile syntax. If filename whitespace is not an issue, either #2 or #3 should be sufficient to solve the problem. But if it is, I imagine 'find' would be a solution, it avoids the other issues provided one doesn't try to read its results into the makefile. But then, why use a makefile?