This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch Makefile.in/Make-lang.in: create bison files atomically


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]