bug-make
[Top][All Lists]
Advanced

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

Documentation error for makefile substitution references


From: John Ulvr (julvr)
Subject: Documentation error for makefile substitution references
Date: Tue, 13 Aug 2019 15:04:34 +0000

 

On this page, the text is incorrect:

 

Substitution references (see Substitution References) are a simpler way to get the effect of the patsubst function:

$(var:pattern=replacement)

is equivalent to

$(patsubst pattern,replacement,$(var))

 

 

In the first example, if pattern/replacement do not contain % characters then this is not true.   (the document specifically says that pattern may contain a %).   I have the following:

 

var=A _A

ifneq ( "$(var:A=B)","$(patsubst A,B,$(var))" )

$(info mismatch... "$(var:A=B)" / "$(patsubst A,B,$(var))" )

endif

 

With output:

 

mismatch... "B _B" / "B _A"

 

John

 


reply via email to

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