This is the mail archive of the
guile-gtk@sources.redhat.com
mailing list for the Guile project.
Re: SMP problems with examples/Makefile.am
- From: Steve Tell <tell at telltronics dot org>
- To: Bo Forslund <bo dot forslund at abc dot se>
- Cc: guile-gtk list <guile-gtk at sourceware dot cygnus dot com>
- Date: Sun, 30 Dec 2001 00:13:41 -0500 (EST)
- Subject: 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