Long Command Lines and @FILE
Joel Sherrill
joel@rtems.org
Fri Sep 17 14:03:20 GMT 2021
On Fri, Sep 17, 2021, 8:45 AM Paul Smith <psmith@gnu.org> wrote:
> On Thu, 2021-09-16 at 22:08 +0200, Florian Weimer via Binutils wrote:
> > Modern GNU make has $(file …) for this purpose. The manual
> > specifically mentions @ listing files:
>
> This is for sure the way to go. It's actually quite tricky to do this
> using foreach and shell, because you can't (obviously) invoke shell
> with all the arguments... and make doesn't have any built-in way to do
> math.
>
> You'd have to use $(words ...) to select a set of words, but you can't
> just loop for "all the words", or "words up to N chars in length", or
> similar things. You have to choose a set of sizes and hard-code the
> looping for that, or else get really fancy (you could do something like
> $(patsubst %,x,...) to change all words to 1 char then invoke $(shell
> ...) to count them and hope that made the list small enough to fit, or
> something).
>
> Requiring $(file ...) is much more robust, if possible. It was added
> in GNU make 4.0, released in Oct 2013.
>
Thanks everyone. There is more guidance in this thread than I could find
elsewhere on the web.
--joel
>
>
More information about the Binutils
mailing list