On Sun, 16 Sep 2012 17:55:23 +0100
Ralph Corderoy <ra...@inputplus.co.uk> wrote:

>     bar.out: bar
>             ./foo bar >bar.out
>             ./foo bar >bar.tmp && mv bar.tmp bar.out

If I might suggest

    bar.out: bar
            ./foo bar >$@~
            @mv $@~ $@

Use of the trailing ~ is unlikely ever to conflict with a real name,
and permits any number of intermediate files, avoiding both confusion
and such barbarisms as "bar.tmp2".  The mv echo can be suppressed
because the intention of the redirection line is clear.  The technique
is portable across different implementations of make,
whereas .INTERMEDIATE is specific to GNU.  

HTH.

--jkl



Reply via email to