From: Steve Tell <tell@telltronics.org>
To: Bo Forslund <bo.forslund@abc.se>
Cc: guile-gtk list <guile-gtk@sourceware.cygnus.com>
Subject: Re: SMP problems with examples/Makefile.am
Date: Sat, 29 Dec 2001 21:13:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.21.0112300006050.26555-100000@ariel.lan.telltronics.org> (raw)
Message-ID: <20011229211300.TKH8DyIvo9D1vinycSxSygYq2yihGK5jclZEIp2fAIw@z> (raw)
In-Reply-To: <3C2E863A.BE4C0EF7@abc.se>
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
next prev parent reply other threads:[~2001-12-29 21:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-18 13:23 Bo Forslund
2001-11-19 14:42 ` Steve Tell [this message]
2001-11-19 14:44 ` Bo Forslund
2001-12-30 9:29 ` Bo Forslund
2001-12-29 21:13 ` Steve Tell
2001-12-29 19:12 ` Bo Forslund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.21.0112300006050.26555-100000@ariel.lan.telltronics.org \
--to=tell@telltronics.org \
--cc=bo.forslund@abc.se \
--cc=guile-gtk@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).