help-make
[Top][All Lists]
Advanced

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

Re: Pattern rules with % matching empty string?


From: Paul Smith
Subject: Re: Pattern rules with % matching empty string?
Date: Fri, 24 Apr 2020 17:39:33 -0400

On Fri, 2020-04-24 at 12:15 +0800, Glen Huang wrote:
> remote-bin-host%: bin
>         scp $< host$*:$<
>         touch $@
> 
> to update files in remote hosts.
> 
> It works for remote-bin-host1, remote-bin-host2, etc, but not remote-
> bin-host. It seems % won’t match empty string.

Another option is to match one extra character:

remote-bin-hos%: bin
        ...

Of course this also matches targets like remote-bin-hosX etc.  If you
can't live with that then your only option is to declare both rules and
either duplicate the recipe or put the recipe in a variable and use
that in both rules, as Philip mentioned.




reply via email to

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