help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getting the value of a make variable into a file


From: Adam Kellas
Subject: getting the value of a make variable into a file
Date: Thu, 7 Apr 2011 15:34:10 -0400

Is there by any chance a clever way of getting the value of a variable
into a file without exposing it to a shell? Eg some variant of

foo:
        @echo $(var) > file

I have some text which is potentially quite convoluted with single and
double quotes and backslashes and literal $ and so on. It needs to get
into a file and I'm fighting with shell and make escaping rules to
make it work. But if there's some cute trick which can avoid all that
and, from within make, open the file and write $(var) to it, I'd be
grateful to know it.

Thanks in advance,
AK



reply via email to

[Prev in Thread] Current Thread [Next in Thread]