How do I get make to generate a list of prerequisites in numerical order? I want to do something like this:
cat file1 file2 file10 file11 file21 | script
When I try this in a bash shell and in the Makefile:
cat file* | script
the files are used in the order file10 file11 file1 file21 file2
which is not what I want. In bash I can force the issue like this:
cat file{[0-9],[0-9][0-9]}
and similar tricks. But I do not know how to get make to recognize these wildcard options and I get many errors when I try to put variations of this in my Makefile:
target: file{[0-9],[0-9][0-9]}
cat $^ | script
Obviously I do not want to list each file individually, I have shown only a few as an example, there are hundreds, and yes, there are gaps. So how do I get a nice make recipe that will use my files nicely in numerical order? (I could rename all the files from [digit] to 0[digit], but that seems like wimping out and avoiding the issue!)
This might work for you: