ma wrote:
"Maxim Yegorushkin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
ma wrote:
I have a make file that is automatically generated. It that makefile,
I have a variable that is very long. It is around 88K long. When I am
trying to pass it to any function (ar for example), the operating system
complains that the command line is too long. The other way is to put this
variable in a text file and call ar in this way:
ar @a.txt
The problem is I don't know how I can write this variable into a file? I
can't use something such as echo $(Long_Var) >a.txt since then the
command line to echo is too long. Is there any way that I can do in
gmake? Is there any function in gmake that help to write a variable into
a file?
You could output the variable word by word to a file:
words = a b c d
foo :
@for w in $(words); do echo -n "$$w " >> $@; done
And then feed the words from the file to ar as command line arguments
using xarg utility.
Thanks Maxim,
It is a very nice trick.
I wrote a batch file as follow and it was working well:
Jens Schweikhardt replied that it still suffers from the very same
problem, that's why it does not work with that many words in your makefile.
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make