From unknown Fri Sep 12 06:30:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10930: touching dependency files, take 2 Resent-From: Bruce Korb Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Fri, 02 Mar 2012 17:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10930 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: bug-autoconf@gnu.org, 10930@debbugs.gnu.org, bug-make@gnu.org X-Debbugs-Original-To: bug-autoconf@gnu.org, bug-automake@gnu.org, bug-make@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.133070818328770 (code B ref -1); Fri, 02 Mar 2012 17:10:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Mar 2012 17:09:43 +0000 Received: from localhost ([127.0.0.1]:58967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3VzD-0007Tm-22 for submit@debbugs.gnu.org; Fri, 02 Mar 2012 12:09:43 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41615) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3Vz0-0007TM-V5 for submit@debbugs.gnu.org; Fri, 02 Mar 2012 12:09:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3VyU-0006NX-1q for submit@debbugs.gnu.org; Fri, 02 Mar 2012 12:08:59 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:60268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3VyT-0006NP-UT for submit@debbugs.gnu.org; Fri, 02 Mar 2012 12:08:57 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3VyP-0008CV-2q for bug-automake@gnu.org; Fri, 02 Mar 2012 12:08:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3VyI-0006CT-NO for bug-automake@gnu.org; Fri, 02 Mar 2012 12:08:52 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:43557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3VyA-00067q-To; Fri, 02 Mar 2012 12:08:38 -0500 Received: from adsl-75-0-191-203.dsl.pltn13.sbcglobal.net ([75.0.191.203]:53343 helo=[192.168.10.2]) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1S3Vy9-0003rW-W6; Fri, 02 Mar 2012 12:08:38 -0500 Message-ID: <4F50FE93.7090002@gnu.org> Date: Fri, 02 Mar 2012 09:08:35 -0800 From: Bruce Korb User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) This is a autoconf, automake and make question, rebuffed in gnulib. It's partly autoconf because autoconf stages dummy dependency files so the make include function won't choke. It is partly make because I find it a bit tricky getting the dependencies just right. It is, I think, mostly an automake question since I think that the machinery behind the AMDEP/DEPDIR configury stuff is automake. The issue is that I have this tool that takes multiple input files and produces multiple output files. "make", of course, was conceived with the idea that each production rule produces one output file. The workaround is to figure out how to have one target file represent the production of the many, often done with "stamp" files. e.g. > target : $(deplist) > touch $@-temp ; $(do-stuff) ; mv $@-temp $@ > > $(target_list) : target This is all well and good when dealing with yacc or lex where the number of inputs and outputs is fairly well constrained. My tool is not so well constrained. So I took a page from GCC. I use "-M" to tell it to produce make file friendly dependency files. But I took it a step farther, and that's what leads to this what-is-the-best-approach question. (I'm getting there.) The make fragment produced contains a list of sources, a list of targets, a sentinel target and the dependency file itself. The sentinel and the dependency fragment may be the same file. Here's an abbreviated example: > t = output ... > s = input ... > > .deps/output-done : $(s) > $(t) : .deps/output-done > @: the main makefile is responsible for the actual "output-done" rule. It would be nice to not have to have that basically empty production rule, but I haven't found a way to avoid it. Without it, you get "no rule to make output" errors. Question 1: Is there a way around this empty rule? When "-MP" is added to the command line, I now produce some phony rules: > .PHONY : clean-.deps/output-done > > clean-.deps/output-done : > rm -f $(t) > touch -t 199912312359 .deps/output-done I'm not happy with that. This is an example where the sentinel file is the dependency file. Were they different, then it would be: > t = output ... > s = input ... > > stamp-foo : $(s) > $(t) : stamp-foo > @: > > .PHONY : clean-stamp-foo > > clean-stamp-foo : > rm -f stamp-foo $(t) I'm also unhappy with this because I now have this stamp file wart, but I also don't have the "touch -t 199912312359" wart. Question 2: Is there a better way? I'd also like to add a line to that fragment: > ag_clean_targets += clean-stamp-foo but it isn't portable. So, pending the decade wait for the "+=" make operator, there must be ways to test for make program capabilities. Question 3: I'm sure it's obvious and I'm just oblivious, but how do I tell if the current make supports "+=" at configure time? Of course, it isn't clear that my clients could use it anyway since they'd have to construct the list for non-"+=" supporting platforms. This renders the utility of $(ag_clean_targets) to be rather small. Any suggestions? Thank you!! Regards, Bruce From unknown Fri Sep 12 06:30:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10930: touching dependency files, take 2 Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Fri, 02 Mar 2012 20:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10930 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Bruce Korb Cc: 10930@debbugs.gnu.org Received: via spool by 10930-submit@debbugs.gnu.org id=B10930.133071987213996 (code B ref 10930); Fri, 02 Mar 2012 20:25:02 +0000 Received: (at 10930) by debbugs.gnu.org; 2 Mar 2012 20:24:32 +0000 Received: from localhost ([127.0.0.1]:59348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3Z1e-0003dR-Mm for submit@debbugs.gnu.org; Fri, 02 Mar 2012 15:24:32 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:44170) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3Z1N-0003cc-Eo; Fri, 02 Mar 2012 15:24:15 -0500 Received: by eeke51 with SMTP id e51so1035618eek.3 for ; Fri, 02 Mar 2012 12:23:36 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.213.31.137 as permitted sender) client-ip=10.213.31.137; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.213.31.137 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.213.31.137]) by 10.213.31.137 with SMTP id y9mr55418ebc.174.1330719816738 (num_hops = 1); Fri, 02 Mar 2012 12:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=CveGkzlxiERH5J1a1t6QH1b7Fu6H0VQ/FBSrGo9IcF4=; b=z8aZ0wF0RM3ILvTJDKkP67SCz01HbljN3Mw39T9SpbHc7EkhH+heIgKNCPI5/O+AKS JZq1MnZfH18E4NCaQj+rNoC6UiL53sMatQZDRPtiwncjG6KwStuWjkswmG9D00FIdyyS IiKf2aIlsnc5DBmBPFhXKqm6PFp93mNivw7gHZDfYZEXg67rV6qlf/JvD3gzxUVq1XHE DSQgpLdV24ZYjGuOBdpEzqLAKRjG++tA4ltpLLOrUOvDgzmqn9iYBBY10SUQ4VA9/BXQ gEcC4xr8h9eZRACII5unnYJmT97xL0mgBwmNScQq72K6BGWQmCDq7OHxOGGkqmYybcgm v8pQ== Received: by 10.213.31.137 with SMTP id y9mr44827ebc.174.1330719816592; Fri, 02 Mar 2012 12:23:36 -0800 (PST) Received: from [79.7.93.100] (host100-93-dynamic.7-79-r.retail.telecomitalia.it. [79.7.93.100]) by mx.google.com with ESMTPS id u9sm24263312eem.11.2012.03.02.12.23.34 (version=SSLv3 cipher=OTHER); Fri, 02 Mar 2012 12:23:35 -0800 (PST) Message-ID: <4F512C45.7010802@gmail.com> Date: Fri, 02 Mar 2012 21:23:33 +0100 From: Stefano Lattarini MIME-Version: 1.0 References: <4F50FE93.7090002@gnu.org> In-Reply-To: <4F50FE93.7090002@gnu.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) tags 10930 notabug close 10930 thanks Hi Bruce. By writing to bug-automake, you have automatically opened a new report in the Automake bug tracker; still, in your mail, you only ask a question, and don't report any actual bug AFAICS. To avoid extra noise in the tracker, I'm thus closing the report you've (probably unwittingly) opened; you should still be able to continue the discussion normally though. In case you think the issue you are facing is truly due to an automake bug, feel free to re-open the report. Regards, Stefano