[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ensure that generated files are read-only
From: |
Paul Eggert |
Subject: |
Re: ensure that generated files are read-only |
Date: |
Thu, 07 Sep 2006 09:13:11 -0700 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Jim Meyering <address@hidden> writes:
> Do you know anyone who prefers that their generated files be writable?
Well, me for starters (:-). It's a minor style thing, but I prefer
that files be marked readonly only when they are intended to be
unchangeable. Removing a readonly file and replacing it with a new
readonly file counts as a change here, since it causes "make" to
regenerate things.
> how about prefixing each new line with "@"
Sometimes that's the best of a bad set of choices, but generally it's
better to omit the '@' so that 'make' output can be cut and pasted
(and understood by humans). Here the @ doesn't save all that much, so
let's omit it.
> For the 9 rules that use "cp", I'd prefer your two-liner, but for the
> fact that the generated files would not necessarily be read-only.
Why wouldn't the generated files be readonly for coreutils?
The source is readonly, so cp will create a readonly destination.
Here's another thought: how about this even-shorter version instead?
alloca.h: alloca_.h
$(LN_F_S) $(srcdir)/alloca_.h $@
where $(LN_FS) expands to "ln -fs" in the typical case, or to
"rm -f $@ && cp" on hosts where "ln -fs" doesn't work (e.g., Solaris 9
and earlier).
Re: ensure that generated files are read-only, Jim Meyering, 2006/09/08
Re: [bug-gnulib] ensure that generated files are read-only, Bruno Haible, 2006/09/07