Re: makefiles writing to $@ should first write to $@.new

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: makefiles writing to $@ should first write to $@.new
Date: 2022-01-24 16:32:08
Message-ID: ad1f1fd3-0648-935a-6a09-763a4fca108e@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 24.01.22 04:23, Justin Pryzby wrote:
> There are many Makefile rules like
>
> foo: bar
> ./tool $< > $@
>
> If the rule is interrupted (due to ^C or ENOSPC), foo can be 0 bytes or
> partially written, but won't be rebuilt until someone runs distclean or debugs
> it and removes the individual file, as I did for errcodes.h.

If a rule fails, make removes the target file. So I don't see how this
can happen unless you hard kill -9 make or something like that.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2022-01-24 16:36:07 Re: Printing backtrace of postgres processes
Previous Message Peter Eisentraut 2022-01-24 15:58:46 Re: PSA: Autoconf has risen from the dead