That's why you do

    foo: bar
        generate bar > tmp && mv tmp foo
So, is there any shell that can do the oftentimes right thing, and delete that file for you if it created it and ‘generate’ fails? Maybe even redirect to a temp file, and rename that on success, delete it on failure (that probably makes the number of variations on this theme too high)

That would make this work from other tools that run shell commands (other makes, cron, etc)

(Bonus points if it also can optionally revert >>, but that’s trickier, as that doesn’t have to be to a file)

It's nice to have, but always pen a .PHONY `clean' target to clarify what to kill before trying again after a big failure.