bug-make
[Top][All Lists]
Advanced

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

Re: .SILENT: clobbered by .SILENT: with_target


From: Britton Kerin
Subject: Re: .SILENT: clobbered by .SILENT: with_target
Date: Wed, 12 Jan 2022 14:22:07 -0900

On Wed, Jan 12, 2022 at 6:17 AM Dmitry Goncharov
<dgoncharov@users.sf.net> wrote:
>
> On Tue, Jan 11, 2022 at 3:50 PM Britton Kerin <britton.kerin@gmail.com> wrote:
> > It looks like the .SILENT: with a recipe clobbers the .SILENT:
> > without
>
> Consider the following
>
> hello.tsk:
> hello.tsk: hello.h
> hello.tsk: hello.o; $(CC) -o $@ $<
>
>
> Here, hello.tsk is the default goal and it depends on hello.o and hello.h.
> Multiple rules can provide different prerequisites to the same target.
> The above is equivalent to
> hello.tsk: hello.o hello.h
> You can see that this example mimics your .silent example.
> Your makefile provided a prerequisite to .SILENT. Make then knows that
> .SILENT has a prerequisite.

I agree that it's consistent syntax, but semantically it's bad.  The
expectation and the manual both imply that .SILENT: will have a global
effect, and a  real union-of-effects would have .SILENT: meaning
everything and .SILENT: some_target redundant.  The root of the
problem is that the rule syntax has been recycled for an unrelated
purpose, especially so for directives without prerequisites.

Britton



reply via email to

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