On Fri, Aug 21, 2009 at 8:14 AM, Yuri Shtil<[email protected]> wrote:
> Philip Guenther wrote:
>> On Thursday, August 20, 2009, Yuri Shtil <[email protected]> wrote:
>>> It look like the shell function is evaluated even though commented out in
>>> the following code:
>>>
>>> define FUNC
>>> ###FOO := $(shell sleep 10)
>>> endef
...
> What is surprising is that a line segment starting with a hash sign must be
> ignored up to the end of the line, this is the whole purpose of having
> comments in the code.

To quote the info pages:
     Within a `define' directive, comments are not ignored during the
     definition of the variable, but rather kept intact in the value of
     the variable.

So it's not a comment when initially read as part of the 'define'.  At
that point you just have a string.  When you expand it, make has to
fully expand the contents (including expanding the nested $(shell))
before parsing it.  The exception would be if you expanded it using
$(value), but that doesn't work for functions where you want to expand
$1, $2, etc.


Philip Guenther


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

Reply via email to