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

Paul Smith <[email protected]>
Newsgroups gmane.comp.gnu.make.general
Organization GNU's Not UNIX!
Message-ID <[email protected]>
On Wed, 2023-10-04 at 23:50 -0700, Kaz Kylheku wrote:
> Is there a good reason for that? The manual mentions only
> performance:

Well, performance is a good reason.  But if you're looking for other
reasons I don't know; this behavior predates me.

> Say that I want to be able to say "make update-host-foo", such that
> Make will run some remote commands on host "foo". For any host name:

The manual tells you how to do this:

| To always rebuild a pattern rule consider using a “force target” (see
| Rules without Recipes or Prerequisites).

>   update-host-%:
>           ssh $* some command

Rewrite as:

  update-host-%: FORCE
          ssh $* some command

  FORCE:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.