Multi-stem pattern rule

Masahiro Yamada <[email protected]> Fri, 31 May 2024 08:44:52 +0900
Newsgroups gmane.comp.gnu.make.general
Message-ID <CAK7LNAT61dwD+KzU6s9H4-MOTdurnNXCpff0L0jtni_AWx4phg@mail.gmail.com>
Hi.

Pattern rules are useful, but in practice, they can
change only the suffix of the target pattern.

Sometimes, I want to change the file prefix as well.
The main purpose is to prepend '.' to the file name
in order to hide less-important files.

For example, like this:

  a/b.x    -->  a/.b.timestamp
  p/q/r.x  -->  p/q/.r.timestamp


Is there a way to achieve this?


Currently, pattern rules can use % just once.

I wish I could do something like this:


%{1}/.%{2}.timestamp : %{1}/%{2}.x
        do_something


-- 
Best Regards
Masahiro Yamada