On Sun, 09 Jun 2019 18:34:47 -0400, Paul Smith <psm...@gnu.org> wrote:
> A pseudo-target .WONTCREATE:
> If that target exists in the makefile then the target existence
> checking is enabled, as follows:
> - Any PHONY rule is not considered
> - After any target is built that actually invoked at least one command,
>   the existence of the target make expected is checked.
>   If it does exist, then no error is given.
> - If the target does NOT exist, then the target is checked against the
>   prerequisites of .WONTCREATE.  If the target is a prerequisite of
>   .WONTCREATE, then no error is given.
> - Else make generates an error as the recipe did not create the target.

I love it!  That's a much better implementation of the goal, thanks.

If I understand correctly, that means that a single:
.WONTCREATE:
will be enough to detect a problem if *all* my rules
are supposed to always create the non-PHONY targets.
That gets me the error detection I was looking for!

I separately posted "Idea: Allow certain special targets as dependencies".
If that is accepted,  I would add .WONTCREATE to that list of
special targets, so people could do this:

~~~~
.WONTCREATE: # By default fail if rule won't create its target

# Don't fail when my_command fails to create weird-thing
weird-thing: .WONTCREATE otherthing
<TAB>my_command
~~~~

--- David A. Wheeler

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to