[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: makefile rules
From: |
Jim Meyering |
Subject: |
Re: makefile rules |
Date: |
Tue, 21 Dec 2021 12:23:10 -0800 |
On Tue, Dec 21, 2021 at 12:12 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
> On 12/21/21 11:50, Jim Meyering wrote:
> > One must delete $@ and the potential $@-t temporary file in any rule
> > that creates a generated file and marks it (as I prefer always to do) as
> > read-only by using chmod to subtract write permissions.
> >
> > Otherwise, the attempt to redirect to $@-t (when it is read-only) will fail.
>
> Gnulib isn't doing a chmod -w so that shouldn't be an issue here.
>
> Quite possibly Gnulib's 'rm -f $@' got copied from earlier recipes that
> did 'chmod -w' for the reason you mention.
>
> If we were going to do a 'chmod -w' then we could do "create $@-t; chmod
> a-w $@-t; mv -f $@-t $@' which (though not perfect) would be good
> enough. Perhaps we didn't do that long ago in coreutils etc. because 'mv
> -f' wasn't universal way back then? It's safe to assume 'mv -f'
> nowadays, though.
[Assuming "create $@-t" may redirect to that file,]
Even with `mv -f` support, one must still either remove $@-t or otherwise
ensure that it is writable. The read-only temporary may have been left behind
from a preceding, interrupted run of the same rule.
- Re: problems in Emacs with GL_GENERATE_STDINT_H, (continued)
- Re: problems in Emacs with GL_GENERATE_STDINT_H, Paul Eggert, 2021/12/18
- Re: problems in Emacs with GL_GENERATE_STDINT_H, Bruno Haible, 2021/12/19
- Re: problems in Emacs with GL_GENERATE_STDINT_H, Paul Eggert, 2021/12/19
- Re: MKDIR_P invocations, Bruno Haible, 2021/12/20
- Re: MKDIR_P invocations, Paul Eggert, 2021/12/20
- Re: MKDIR_P invocations, Bruno Haible, 2021/12/21
- Re: makefile rules, Bruno Haible, 2021/12/21
- Re: makefile rules, Paul Eggert, 2021/12/21
- Re: makefile rules, Jim Meyering, 2021/12/21
- Re: makefile rules, Paul Eggert, 2021/12/21
- Re: makefile rules,
Jim Meyering <=
- Re: makefile rules, Paul Eggert, 2021/12/21
- Re: makefile rules, Jim Meyering, 2021/12/22
- Re: makefile rules, Bruno Haible, 2021/12/21
- Re: makefile rules, Bruno Haible, 2021/12/21
- Re: makefile rules, Paul Eggert, 2021/12/22
- Re: makefile rules, Paul Eggert, 2021/12/23
- Re: makefile rules, Bruno Haible, 2021/12/24
- Re: makefile rules, Bruno Haible, 2021/12/24
- Re: makefile rules, Paul Eggert, 2021/12/24
- Re: makefile rules, Bruno Haible, 2021/12/24