[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Idea: Standard way to negate special targets
From: |
Paul Smith |
Subject: |
Re: Idea: Standard way to negate special targets |
Date: |
Wed, 12 Jun 2019 11:59:50 -0400 |
On Wed, 2019-06-12 at 10:15 -0400, David A. Wheeler wrote:
> > What about modifying the target name itself, like:
> >
> > tricky_target: .!ONESHELL .PHONY ...
>
> I think modifying the target name itself is MUCH worse.
>
> I don't the problem is serious, but I *do* see your point.
>
> I think a better alternative syntax would be to start with "!"
> *without* a space after it. For example:
>
> tricky_target: !.ONESHELL .PHONY ...
>
> There's some logic to it; the prerequisites are space-separated,
> and now they're still space-separated including the "not a
> prerequisite" statement.
I don't like having whitespace be meaningful here unless it's useful
for some reason. So, I would not make a distinction between:
tricky_target: ! .ONESHELL
and:
tricky_target: !.ONESHELL
To me the "!" is an operator and I don't see any point in having it
behave differently based on whitespace.
There's already too much whitespace-awareness in make as is IMO :).
That's why I suggested embedding the "!" in the target name but if
people don't like that, then we should just document that the "!" binds
to the next target and leave it at that IMO.