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.