[HELP] PHONY pattern rule makes the file w/ the same name

2023-10-04 Thread Bahman Movaqar
Hey all 👋 To my mind, whenever a target is marked as PHONY it is supposed to simply ignore files with the same name. And that should be the behaviour of PHONY pattern rules too. With that said, I need some help understanding what happens in the following scenario please. ——

Re: [HELP] PHONY pattern rule makes the file w/ the same name

2023-10-04 Thread Paul Smith
On Wed, 2023-10-04 at 07:34 -0700, Bahman Movaqar wrote: > .PHONY : echo.% That makes the specific target named, literally, "echo.%" into a phony target. .PHONY doesn't accept wildcards.

Re: [HELP] PHONY pattern rule makes the file w/ the same name

2023-10-04 Thread Bahman Movaqar
Hit "Send" too soon. To make matters more complicated, in the previous snippet, if I declare `echo.%' as below (w/o any pattern-rule prerequisite) then Make behaves as expected. — ###

Re: [HELP] PHONY pattern rule makes the file w/ the same name

2023-10-04 Thread Bahman Movaqar
On Wed, 2023-10-04 at 10:38 -0400, Paul Smith wrote: > On Wed, 2023-10-04 at 07:34 -0700, Bahman Movaqar wrote: > > .PHONY : echo.% > > That makes the specific target named, literally, "echo.%" into a phony > target.  .PHONY doesn't accept wildcards. TIL   Thanks for the answer. Though this con

Re: [HELP] PHONY pattern rule makes the file w/ the same name

2023-10-04 Thread Paul Smith
On Wed, 2023-10-04 at 07:40 -0700, Bahman Movaqar wrote: > To make matters more complicated, in the previous snippet, if I > declare `echo.%' as below (w/o any pattern-rule prerequisite) then > Make behaves as expected. Sorry but I don't really understand the problem. Maybe you can explain it mor

Re: [HELP] PHONY pattern rule makes the file w/ the same name

2023-10-04 Thread Kaz Kylheku
On 2023-10-04 07:55, Paul Smith wrote: > It also means that implicit rules are not searched, for PHONY targets. Is there a good reason for that? The manual mentions only performance: The implicit rule search (see Using Implicit Rules) is skipped for .PHONY targets. This is why declaring a tar