Re: Initial refactoring of plperl.c - updated

Поиск
Список
Период
Сортировка
От Tim Bunce
Тема Re: Initial refactoring of plperl.c - updated
Дата
Msg-id 20100109234922.GE2481@timac.local
обсуждение исходный текст
Ответ на Re: Initial refactoring of plperl.c - updated  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Initial refactoring of plperl.c - updated  (Tim Bunce <Tim.Bunce@pobox.com>)
Re: Initial refactoring of plperl.c - updated  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Jan 09, 2010 at 11:16:18PM +0200, Peter Eisentraut wrote:
> On fre, 2010-01-08 at 12:46 +0000, Tim Bunce wrote:
> > *** 45,50 ****
> > --- 45,55 ----
> >   
> >   include $(top_srcdir)/src/Makefile.shlib
> >   
> > + plperl.o: perlchunks.h
> > + 
> > + perlchunks.h: plc_*.pl
> > +       $(PERL) text2macro.pl --strip='^(\#.*|\s*)$$' plc_*.pl >
> > perlchunks.htmp
> > +       mv perlchunks.htmp perlchunks.h
> >   
> >   all: all-lib
> 
> What's the reason for the temp file here?

Defensive. If the text2macro.pl program fails/dies then you'd be left
with a broken output file with a newer timestamp, so the next make
wouldn't rerun text2macro.pl.

Tim.

p.s. In the makefile for perl we use a little utility called mv_if_diff
instead of a plain mv so that any downstream dependencies only get
rebuilt if the contents have changed.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Add .gitignore files to CVS?
Следующее
От: Tim Bunce
Дата:
Сообщение: Re: Initial refactoring of plperl.c - updated