bug-make
[Top][All Lists]
Advanced

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

Re: Manual, ch. 6.2 The Two Flavors of Variables, section simply expande


From: Paul Smith
Subject: Re: Manual, ch. 6.2 The Two Flavors of Variables, section simply expanded.. controlled leading whitespace, page 63
Date: Wed, 09 Dec 2020 09:41:28 -0500
User-agent: Evolution 3.36.4-0ubuntu1

On Wed, 2020-12-09 at 12:42 +0000, DUDZIAK Krzysztof wrote:
> Why is a variable of null-string value used to protect leading space?

Stripping of leading space in a variable assignment happens while the
makefile is being parsed and BEFORE any part of the line is expanded.

So, any non-space character that appears in the line (after the
assignment operator) before expansion marks the start of the text.  It
doesn't matter what happens AFTER expansion (for example it doesn't
matter if a variable expands to the empty string or not).

> Following statement is also made in ch. 6.2: Leading whitespace
> characters are discarded from your input before substitution of
> variable references and function calls. Is this a behavior common for
> variables of both types of expandability, simply and recursive?

All types of variables are treated the same way, because the stripping
happens before any of that: it happens _during parse_ of the makefile,
when make is splitting the input line into parts.  This happens before
it examines the type of assignment or decides whether to expand any
strings, or not expand.




reply via email to

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