help-make
[Top][All Lists]
Advanced

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

Re: Proper usage of multiple rules for the same targets


From: Tiphaine Turpin
Subject: Re: Proper usage of multiple rules for the same targets
Date: Wed, 5 Sep 2018 07:04:05 +0000

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.






reply via email to

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