help-make
[Top][All Lists]
Advanced

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

Re: Hot to write pattern rules for suffix deletion


From: Stephen Touset
Subject: Re: Hot to write pattern rules for suffix deletion
Date: Sun, 28 Jan 2024 17:54:50 -0500

On Jan 4, 2024 at 23:50:44, Philip Guenther <guenther@gmail.com> wrote:

> On Thu, Jan 4, 2024 at 8:51 PM Stephen Touset <stephen@touset.org> wrote:
>
>>
>>     %: %.envsubst
>>         envsubst < $< > $@
>>
>> Obviously this rule isn't correct.
>
>
> Can you explain why you don't believe that to be correct?  Given that a
> pattern rule only applies when the prerequisites either exist or make knows
> how to create them, why wouldn't that work?
>

You were 100% right. I thought this wouldn’t work since it would create a
rule for every possible target, but make does the right thing here as you
pointed out and *only* matches this pattern when the prerequisite exists.

Thanks!

-- 
Stephen Touset <stephen@touset.org>


reply via email to

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