This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch Makefile.in/Make-lang.in: create bison files atomically
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch Makefile.in/Make-lang.in: create bison files atomically
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 12 Oct 2000 17:46:23 -0200
- Cc: gcc-patches at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <200010121930.PAA17628@caip.rutgers.edu>
On Oct 12, 2000, "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> wrote:
> So I went through and changed the output filename for files generated
> in the srcdir to utilize shell $$ ($$$$ in make) so that the name is
> unique. Then I move the unique file to the target name atomically.
I don't think you want move-if-change. In case there's no change, the
file will end up being rebuilt over and over, since its timestamp
won't change. How about something like:
rm -f output-name || : ; \
mv on$$ output-name || rm on$$
?
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me