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 <[email protected]>          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


_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to