Hi,
The reason for the added dependency was that I am using a compiler which can itself be changed (not in the same Makefile, though), and I wanted to make sure that the source files are recompiled when this tool changes. So a more concrete example is: %.t : %.x x2t $< %.t : x2t Of course, in this very simple case, the dependency can be added to the first pattern rule, which solves the issue. But in fact there are other dependencies that should trigger the rebuild when they change (libraries built by some other Makefile) and there are also other occurrences of using the same compiler and associated libraries in the Makefile, in specialized rules, so I found it more readable to use a separate rule to add the same dependencies to all the relevant targets. Adding the dependency to each rule also requires to slightly adapt some rules, for example if they were using $^ in their recipe. So, there is no absolute need to use an additional rule, but I thought it was the most natural way to proceed when I wrote it. Best Regards, Tiphaine ________________________________ From: Sébastien Hinderer Subject: Re: Proper usage of multiple rules for the same targets Date: Tue, 4 Sep 2018 15:18:37 +0200 ________________________________ Dear Tiphaine, At the moment I can't come up with another way to solve the problem you describe, sorry. However, would you be able to describe in more details the context and what you are trying to achieve? Perhaps if we understand what exactly you are trying to do we can come up with another solution? Best wishes, Sébastien. _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make