%% Jonathan Thornburg <[EMAIL PROTECTED]> writes:
jt> This is either a bug in how the patsubst function works in GNU Make
jt> 3.79, or a bug in the documentation for same:
jt> files := $(patsubst %, ../%/%.gfa, $(dirs))
jt> The GNU Make 3.79 info file says
>> `$(patsubst PATTERN,REPLACEMENT,TEXT)'
>> Finds whitespace-separated words in TEXT that match PATTERN and
>> replaces them with REPLACEMENT. Here PATTERN may contain a `%'
>> which acts as a wildcard, matching any number of any characters
>> within a word. If REPLACEMENT also contains a `%', the `%' is
>> replaced by the text that matched the `%' in PATTERN.
jt> but it doesn't say what happens if there are multiple `%'
jt> characters in REPLACEMENT.
Well... if you're pedantic it always refers to `%' in a singular sense:
"_a_ `%'", "_the_ `%'", etc. (emphasis added of course). I agree that's
more obscure than it should be, and this should be made clear.
jt> In my opinion the "right" behavior would be to substitute all of
jt> them, but it appears Make only substitutes the first.
I'll see if I can figure out the reason this was implemented as it was.
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist