From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12773 invoked by alias); 21 Nov 2010 23:53:36 -0000 Received: (qmail 12759 invoked by uid 22791); 21 Nov 2010 23:53:34 -0000 X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM X-Spam-Check-By: sourceware.org Received: from new1.smtp.messagingengine.com (HELO new1.smtp.messagingengine.com) (66.111.4.221) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 21 Nov 2010 23:53:28 +0000 Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id EA81720D27; Sun, 21 Nov 2010 18:53:26 -0500 (EST) Received: from frontend1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 21 Nov 2010 18:53:26 -0500 Received: from [74.79.28.150] (cpe-74-79-28-150.twcny.res.rr.com [74.79.28.150]) by mail.messagingengine.com (Postfix) with ESMTPSA id 2841C400D2F; Sun, 21 Nov 2010 18:53:25 -0500 (EST) Message-ID: <4CE9B0F1.4050905@fastmail.fm> Date: Mon, 22 Nov 2010 05:49:00 -0000 From: "Nathanael Nerode (GCC)" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: Ralf Wildenhues , Joern Rennecke , Paolo Bonzini , gcc-patches@gcc.gnu.org, DJ Delorie , Alexandre Oliva Subject: Re: copying a timestamp References: <20100629172139.7sxigvan4g48koss-nzlynne@webmail.spamcop.net> <20101104090834.yzg2549rks8o84wg-nzlynne@webmail.spamcop.net> <20101112091310.xfc3pvh9ogw0sskg-nzlynne@webmail.spamcop.net> <4CDD502D.9060405@gnu.org> <20101112100204.lhw5uyhrpcswogo8-nzlynne@webmail.spamcop.net> <4CDD5805.8040708@gnu.org> <20101112110038.qzd8l0pbgo4swgs8-nzlynne@webmail.spamcop.net> <20101114094629.21cjtbpj8gogcogg-nzlynne@webmail.spamcop.net> <4CE0A07C.4090500@fastmail.fm> <20101120210054.GF24876@gmx.de> In-Reply-To: <20101120210054.GF24876@gmx.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-11/txt/msg02208.txt.bz2 On 11/20/2010 04:00 PM, Ralf Wildenhues wrote: > The reply from Paul is still mostly correct though: make walks the > complete dependency tree down and then back up. When walking back up, > the mechanism you desire is easily implemented in a small shell command > (as shown in the example of Paul's reply). It's dependent on timestamp files which can be poked, prodded, and otherwise convinced to do the wrong thing by the user. It's fundamentally *not robust*, is the main issue. > When first walking down, you just need to ensure that the graph really > is a tree. There are (at least) two choices you can make at that time, > and in GNU make you can implement them with arbitrary shell statements: > > - should T be updated if P is newer? > > T : $(shell if $$condition; then echo P; fi) The problematic part is that you're scattering bogus timestamp files (P!) all over the tree. This makes it very brittle. I suppose one could construct a special subtree of timestamps which is blown away fresh with each invocation.... that would make it *slightly more* robust. Not *much* more. > - should T, if it is to be updated, be updated after P is updated > (order-only dependency, since GNU make 3.80)? > > T : | $(shell if $$condition; then echo P; fi) > > So, in summary, I think what you want is already possible, albeit maybe > not in a concise notation. It's not so much the notation (although that is a problem) as the scattering of bogus timestamp files. It is true that by introducing an auxilliary file to represent *each* logical state, and manipulating its timestamp by hand to be "true" or "false", you can "solve" the problem, but this is *not robust*, because the timestamp files are exposed to general programmer manipulation. A special timestamp subdirectory tree would ameliorate that somewhat. It is also, incidentally, slow, due to the heavy reliance on filesystem access and modification, for things for which the filesystem is, fundamentally, quite irrelevant. I suppose it could be sped up with a mounted ramdisk for the timestamp tree, but you begin to see how ridiculous this set of kludges is.