bug-make
[Top][All Lists]
Advanced

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

Re: define strangeness


From: Boris Kolpackov
Subject: Re: define strangeness
Date: Fri, 16 Apr 2004 15:40:56 -0500
User-agent: Mutt/1.5.4i

Paul D. Smith <address@hidden> writes:
 
>   bk> Consider this makefile:
> 
>   bk> foobar := world
> 
>   bk> define name
>   bk> \
>   bk> foobar
>   bk> endef
> 
>   bk> .PHONY: hello
>   bk> hello: ; @echo hello $(value $(name))
> 
>   bk> It prints just "hello". I would guess it is because define assigns
>   bk> the value verbatim
> 
> Correct.
> 
> It's not clear to me how you expect this to behave.  By the time make
> starts to expand variables it has already resolved all the
> backslash/newline pairs: it has to do this first or nothing works
> properly.

This is true except that make doesn't do it inside "define".

> Are you saying that it should perform _ANOTHER_ round of
> backslash/newline resolution at some point during the parsing or
> expansion of variables?

No, I think it should handle newline-backslash sequence the same 
way everywhere, including inside "define".

> How will this impact backward compatibility?  

I think it won't. I doubt anybody actually employes this behavior
of make wrt newline-backslash processing. I think the same applies
to comments inside "define".

All this seems pretty obvious to me unless I miss something big
(and in this case I bet you would gladly point it out ;-)). 

thanks,
-boris

Attachment: signature.asc
Description: Digital signature


reply via email to

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