From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16913 invoked by alias); 30 Dec 2001 05:13:49 -0000 Mailing-List: contact guile-gtk-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: guile-gtk-owner@sources.redhat.com Received: (qmail 16878 invoked from network); 30 Dec 2001 05:13:46 -0000 Received: from unknown (HELO telltronics.org) (66.92.218.26) by sources.redhat.com with SMTP; 30 Dec 2001 05:13:46 -0000 Received: from localhost (tell@localhost) by telltronics.org (8.9.3/8.9.3) with ESMTP id AAA21326; Sun, 30 Dec 2001 00:13:42 -0500 Date: Mon, 19 Nov 2001 14:42:00 -0000 From: Steve Tell X-Sender: tell@ariel.lan.telltronics.org To: Bo Forslund cc: guile-gtk list Subject: Re: SMP problems with examples/Makefile.am In-Reply-To: <3C2E863A.BE4C0EF7@abc.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2001-q4/txt/msg00025.txt.bz2 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Tell To: Bo Forslund Cc: guile-gtk list Subject: Re: SMP problems with examples/Makefile.am Date: Sat, 29 Dec 2001 21:13:00 -0000 Message-ID: References: <3C2E863A.BE4C0EF7@abc.se> X-SW-Source: 2001-q4/msg00037.html Message-ID: <20011229211300.TKH8DyIvo9D1vinycSxSygYq2yihGK5jclZEIp2fAIw@z> 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