help-make
[Top][All Lists]
Advanced

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

Re: multiple percent signs in single prerequisite - revisited


From: Paul Smith
Subject: Re: multiple percent signs in single prerequisite - revisited
Date: Tue, 19 Jul 2022 10:05:40 -0400
User-agent: Evolution 3.44.3 (by Flathub.org)

On Tue, 2022-07-19 at 08:44 +0200, Peter Apian-Bennewitz wrote:
> A rule like
> 
>       %.mp4: %/%.mov
> or
>      %.mp4: foo_%_%.bar
> 
> substitutes only the first % while looking for matching
> prerequisites. - why ?

Because that's the way it was implemented, and documented, and that's
the way it's always worked...

I know of no reason other than that's how Roland (or RMS?  Not sure who
created pattern rules back in the day) did it.  At this point there
would be a backward-compatibility problem with trying to change it.

You can get around this if you use secondary expansion[1] capabilities:

  .SECONDEXPANSION:

  %.mp4: $$*/$$*/mov

or

  %.mp4: foo_$$*_$$*.bar



[1] https://www.gnu.org/software/make/manual/html_node/Secondary-Expansion.html



reply via email to

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