help-make
[Top][All Lists]
Advanced

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

Re: a question about patsubst function


From: Paul Smith
Subject: Re: a question about patsubst function
Date: Sun, 01 May 2011 13:51:21 -0400

On Sun, 2011-05-01 at 11:15 +0430, ali hagigat wrote:
> var=$(patsubst  \%%book,booklet,%now my book is read)
> all: ;
> $(warning $(var))
> makefile27:3: %now my book is read
> make: `all' is up to date.
> -------------------------------
> Why the resulting text is not "booklet is read"?
> (Our pattern is "%"+"any characters"+"book"  and it should be replaced
> with "booklet" )

patsubst matches the pattern against each WORD individually.  Words are
separated by whitespace.

Make asks, does the word "%now" match \%%book?  No.
Does the word "my" match?  No.
Does the word "book" match?  No.
etc.

None of these words match so nothing is substituted and you get back the
same result you passed in.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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