This is the mail archive of the guile-gtk@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SMP problems with examples/Makefile.am


On Sun, 30 Dec 2001, Bo Forslund wrote:

> Makefile built by the original Makefile.am containing the lines
> 
> foo-glue.c: foo.defs
>  build-guile-gtk glue $< >tmp && mv tmp $@
> 
> main.c: foo.defs
>  build-guile-gtk main $< >tmp && mv tmp $@

I believe the point of the " >tmp && mv tmp $@" construct is that the
final target $@ is not touched unless build-guile-gtk completes
successfully with a zero exit status.

"A && B" is sh for "run A, and if successful then run B" 

If build-guile-gtk aborts due to signal or error, a subsequent make will
still find foo-glue.c or main.c out of date and rebuild them completely,
not being fooled by a recent modification time on an empty or incomplete
file.

Using a parallel make, both rules can execute at once and stomp on each
other writing to the same "tmp" file simultaneously.

Perhaps best would be to use different temporary file names, say based on
(but not the same as) the final target name:

> foo-glue.c: foo.defs
>  build-guile-gtk glue $< >$@.new && mv $@.new $@
> 
> main.c: foo.defs
>  build-guile-gtk main $< >$@.new && mv $@.new $@



--
Steve Tell  tell@telltronics.org 


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