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.