On 04/09/2014 11:40 AM, Rakesh Sharma wrote:
Hello Guenther,

Thanks for the tips about the $(origin varname) function. That is solving the 
problems I was having. As regards the value of the variable I like to keep them 
in 3 domains:

unset <- never been defined (or undefined midway)
null <- defined but set to an empty value (/^$/) => length($var) = 0
nonnull <- defined & set to a nonnull value(even if all spaces /^\s+$/ or /\S/ or 
better still /./)   =>  length($var) > 0

But like you mentioned, I am coming around to the fact that null or unset 
variables need to be clubbed together in make.

I am finding a great dichotomy in the way make handles newlines embedded within 
make variables. $(info ...$(string_with_NLs_)  outputs ok,
but the same string when used inside recipies (i.e., shell) creates untold 
misery. No amount of escaping, subst, etc. seem to help here.

Rakesh,

It can be quite tricky to use variables with embedded newlines in make. If you're using GNU make 4.0, the $(file) function may provide you a solution. Otherwise, this answer on StackOverflow may help:

http://stackoverflow.com/a/649462/77345

Best regards,

Eric Melski
Chief Architect
Electric Cloud, Inc.
http://blog.melski.net



_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to