GNU bug report logs - #13104
Extending automake rules w.r.t dependencies

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: automake; Reported by: "Theophile Ranquet" <ranquet@HIDDEN>; dated Thu, 6 Dec 2012 17:07:02 UTC; Maintainer for automake is bug-automake@HIDDEN.

Message received at 13104 <at> debbugs.gnu.org:


Received: (at 13104) by debbugs.gnu.org; 7 Dec 2012 09:46:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 07 04:46:27 2012
Received: from localhost ([127.0.0.1]:57919 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TguVn-0003b4-3c
	for submit <at> debbugs.gnu.org; Fri, 07 Dec 2012 04:46:27 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:46983
	helo=kualalumpur.lrde.epita.fr)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <ranquet@HIDDEN>) id 1TguVi-0003at-Mg
	for 13104 <at> debbugs.gnu.org; Fri, 07 Dec 2012 04:46:24 -0500
Received: from localhost ([127.0.0.1] helo=webmail.lrde.epita.fr)
	by kualalumpur.lrde.epita.fr with esmtp (Exim 4.63)
	(envelope-from <ranquet@HIDDEN>)
	id 1TguVN-0002LF-GU; Fri, 07 Dec 2012 10:46:01 +0100
Received: from 192.168.101.52 (SquirrelMail authenticated user ranquet)
	by webmail.lrde.epita.fr with HTTP;
	Fri, 7 Dec 2012 10:46:01 +0100 (CET)
Message-ID: <48795.192.168.101.52.1354873561.squirrel@HIDDEN>
In-Reply-To: <20121206221635.GA24126@HIDDEN>
References: <47897.192.168.101.52.1354808484.squirrel@HIDDEN>
	<20121206221635.GA24126@HIDDEN>
Date: Fri, 7 Dec 2012 10:46:01 +0100 (CET)
Subject: Re: bug#13104: Extending automake rules w.r.t dependencies
From: "Theophile Ranquet" <ranquet@HIDDEN>
To: "Nick Bowler" <nbowler@HIDDEN>
User-Agent: SquirrelMail/1.4.9a
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 13104
Cc: Theophile Ranquet <ranquet@HIDDEN>, 13104 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> Hello,

Hi,

> The usual workaround to add prerequisites to an automake-generated
> rule is to use a one-off make variable for the target name.  For
> example,
>
>   doc_bison_dvi = doc/bison.dvi
>   $(doc_bison_dvi): $(FIGS_DOT:.dot=.eps)
>
> and so on.  Automake does a simple string comparison of the target name
> to decide whether or the generated rule is overridden, so using a
> variable will hide the "real" target name from this check.  Note that
> this is only appropriate for rules with no commands.

We did something similar, with a little tweak because using three
variables seemed a bit of an overkill:

commit 476af12837af129d36b302e30789c549c85fdadb
Author: Theophile Ranquet <ranquet@HIDDEN>
Date:   Tue Dec 4 16:09:24 2012 +0100

    doc: fix build dependencies

    * doc/local.mk: Avoid overwriting Automake's rules.

diff --git a/doc/local.mk b/doc/local.mk
index aaea996..cef4448 100644
--- a/doc/local.mk
+++ b/doc/local.mk
@@ -20,7 +20,14 @@ doc_bison_TEXINFOS =                            \
   doc/fdl.texi                                  \
   doc/gpl-3.0.texi

-TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d
+# Cannot express dependencies directly on file names because of Automake.
+# Obfuscate with a variable.
+doc_bison = doc/bison
+$(doc_bison).dvi: $(FIGS_DOT:.dot=.eps)
+$(doc_bison).pdf: $(FIGS_DOT:.dot=.pdf)
+$(doc_bison).html: $(FIGS_DOT:.dot=.html)
+
+TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d -I doc
 CLEANDIRS = doc/bison.t2d
 clean-local:
 	rm -rf $(CLEANDIRS)
@@ -123,10 +130,6 @@ EXTRA_DIST +=								\
   $(FIGS_DOT:.dot=.eps) $(FIGS_DOT:.dot=.pdf) $(FIGS_DOT:.dot=.png)
 SUFFIXES += .dot .eps .pdf .png

-doc/bison.dvi:  $(FIGS_DOT:.dot=.eps)
-doc/bison.html: $(FIGS_DOT:.dot=.png)
-doc/bison.pdf:  $(FIGS_DOT:.dot=.pdf)
-
 .dot.eps:
 	$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
 	$(AM_V_at) $(DOT) -Gmargin=0 -Teps $< >$@.tmp



> Hope that helps,

It did, thanks!





Information forwarded to bug-automake@HIDDEN:
bug#13104; Package automake. Full text available.

Message received at 13104 <at> debbugs.gnu.org:


Received: (at 13104) by debbugs.gnu.org; 7 Dec 2012 09:04:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 07 04:04:42 2012
Received: from localhost ([127.0.0.1]:57834 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TgtrO-0002Ze-6H
	for submit <at> debbugs.gnu.org; Fri, 07 Dec 2012 04:04:42 -0500
Received: from mail-bk0-f44.google.com ([209.85.214.44]:51844)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1TgtrL-0002ZV-0j
	for 13104 <at> debbugs.gnu.org; Fri, 07 Dec 2012 04:04:40 -0500
Received: by mail-bk0-f44.google.com with SMTP id w11so93089bku.3
	for <13104 <at> debbugs.gnu.org>; Fri, 07 Dec 2012 01:04:20 -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=REW2DhX28kRHaU/i8k3Ar2PHAYLXkVHKzvGdnNct4jM=;
	b=G5CTzY+NVxJvDHw5EQ6it7H9JjHcVxW7Fk9KSObYpR/wK35eg52qQhMEvsesndESyn
	XJv6F94O84pfjxmOe/zeH3AVeCppXlqtUlIfGUJBdm1QJRsmN0+ytMiqvQ0P/7COoOFq
	0mW6Ot8LcrtqTUGLlLa6O8zZavdm++YunGKeat7jXgLDAmOZVm8uXikrTdFGgiPFP9Wr
	PgVIVeg0Rgsa11t/qO7QPlV6HREM+qB7W8aXRZ5rCBL/IdOkC6VbL1pU269JIrjjRP1u
	UMpuOnkaNyTTfQSycp84bbwHkQBGC6FJWSvyRX9oP0gjzt4NWD3XkP7Wat/C3FvRojwa
	8j9g==
Received: by 10.204.4.145 with SMTP id 17mr1714862bkr.34.1354871059230;
	Fri, 07 Dec 2012 01:04:19 -0800 (PST)
Received: from [192.168.178.21]
	(host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137])
	by mx.google.com with ESMTPS id m20sm8249243bkw.4.2012.12.07.01.04.17
	(version=SSLv3 cipher=OTHER); Fri, 07 Dec 2012 01:04:18 -0800 (PST)
Message-ID: <50C1B10F.5070102@HIDDEN>
Date: Fri, 07 Dec 2012 10:04:15 +0100
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
MIME-Version: 1.0
To: Nick Bowler <nbowler@HIDDEN>
Subject: Re: bug#13104: Extending automake rules w.r.t dependencies
References: <47897.192.168.101.52.1354808484.squirrel@HIDDEN>
	<20121206221635.GA24126@HIDDEN>
In-Reply-To: <20121206221635.GA24126@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 13104
Cc: Theophile Ranquet <ranquet@HIDDEN>, 13104 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

Hi Theophile, nick.

On 12/06/2012 11:16 PM, Nick Bowler wrote:
> Hello,
> 
> On 2012-12-06 16:41 +0100, Theophile Ranquet wrote:
>> I am seeking advice for a workaround of what seems like a limitation
>> in Automake (1.12.2).
>>
>> We have recently added figures to Bison's documentation. These figures
>> are included by our texinfo source by using "@image", which requires
>> different image formats depending on what we want to produce. For
>> convenience's sake, these figures are generated from Graphviz DOT
>> files, so we tried adding the following to our doc/local.mk:
>>
>> doc/bison.dvi:  $(FIGS_DOT:.dot=.eps)
>> doc/bison.html: $(FIGS_DOT:.dot=.png)
>> doc/bison.pdf:  $(FIGS_DOT:.dot=.pdf)
>>
>> However, these overwrite Automake's rules.
>
Yeah, a long-standing behaviour, but one that I've never liked.

Ideally we could improve the makefile parser to check whether a
target has an associated recipe, and only in that case make it
override a built-in (or a previous user-defined) target; in the
other cases, it should be just considered a declaration of extra
dependencies.  After all, that is how (GNU) make itself behaves.

This is something to consider for Automake 1.14 (which will only
be released several months from now, at best).  Patches would be
extremely welcome :-)

In the meantime ...

>> This seems a bit similar,
>> in that regard, to the issue discussed here:
>> http://lists.gnu.org/archive/html/automake/2012-11/msg00015.html
> 
> The usual workaround to add prerequisites to an automake-generated
> rule is to use a one-off make variable for the target name.  For
> example,
> 
>   doc_bison_dvi = doc/bison.dvi
>   $(doc_bison_dvi): $(FIGS_DOT:.dot=.eps)
> 
> and so on.  Automake does a simple string comparison of the target name
> to decide whether or the generated rule is overridden, so using a
> variable will hide the "real" target name from this check.  Note that
> this is only appropriate for rules with no commands.
>
... I'd follow this suggestion from Nick, which is absolutely correct.

>> (Note that in another branch we are using multiple Makefiles, and in
>> that branch adding the previous lines to our doc/Makefile.am has the
>> desired effect, though I am not sure why... is this a bug or a
>> feature?)
> 
> Hard to say without looking a concrete example, but the most likely
> explanation is that the Automake-generated rules are different in the
> recursive case, such that your custom rules don't actually override
> anything.
> 
> Hope that helps,

Thanks,
  Stefano




Information forwarded to bug-automake@HIDDEN:
bug#13104; Package automake. Full text available.

Message received at 13104 <at> debbugs.gnu.org:


Received: (at 13104) by debbugs.gnu.org; 6 Dec 2012 22:16:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 06 17:16:56 2012
Received: from localhost ([127.0.0.1]:57428 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TgjkV-0002zR-Vv
	for submit <at> debbugs.gnu.org; Thu, 06 Dec 2012 17:16:56 -0500
Received: from mx.scalarmail.ca ([98.158.95.75]:49571
	helo=ironport-01.sms.scalar.ca)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <prvs=nbowler=680b1c9be@HIDDEN>)
	id 1TgjkS-0002zI-Pr
	for 13104 <at> debbugs.gnu.org; Thu, 06 Dec 2012 17:16:54 -0500
Received: from unknown (HELO sms-zimbra-mta-02.sms.scalar.ca) ([192.168.32.56])
	by ironport-01.sms.scalar.ca with ESMTP; 06 Dec 2012 17:16:37 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
	by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTP id 04F1187C1D; 
	Thu,  6 Dec 2012 17:16:37 -0500 (EST)
Received: from sms-zimbra-mta-02.sms.scalar.ca ([127.0.0.1])
	by localhost (sms-zimbra-mta-02.sms.scalar.ca [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id gmEi6JqPOSVk; Thu,  6 Dec 2012 17:16:36 -0500 (EST)
Received: from mail.ellipticsemi.com (dsl-67-204-24-19.acanac.net
	[67.204.24.19]) (Authenticated sender: nbowler@HIDDEN)
	by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTPSA id E0FF587C1B;
	Thu,  6 Dec 2012 17:16:35 -0500 (EST)
Date: Thu, 6 Dec 2012 17:16:35 -0500
From: Nick Bowler <nbowler@HIDDEN>
To: Theophile Ranquet <ranquet@HIDDEN>
Subject: Re: bug#13104: Extending automake rules w.r.t dependencies
Message-ID: <20121206221635.GA24126@HIDDEN>
References: <47897.192.168.101.52.1354808484.squirrel@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47897.192.168.101.52.1354808484.squirrel@HIDDEN>
Organization: Elliptic Technologies Inc.
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 13104
Cc: 13104 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 0.8 (/)

Hello,

On 2012-12-06 16:41 +0100, Theophile Ranquet wrote:
> I am seeking advice for a workaround of what seems like a limitation
> in Automake (1.12.2).
> 
> We have recently added figures to Bison's documentation. These figures
> are included by our texinfo source by using "@image", which requires
> different image formats depending on what we want to produce. For
> convenience's sake, these figures are generated from Graphviz DOT
> files, so we tried adding the following to our doc/local.mk:
> 
> doc/bison.dvi:  $(FIGS_DOT:.dot=.eps)
> doc/bison.html: $(FIGS_DOT:.dot=.png)
> doc/bison.pdf:  $(FIGS_DOT:.dot=.pdf)
> 
> However, these overwrite Automake's rules. This seems a bit similar,
> in that regard, to the issue discussed here:
> http://lists.gnu.org/archive/html/automake/2012-11/msg00015.html

The usual workaround to add prerequisites to an automake-generated
rule is to use a one-off make variable for the target name.  For
example,

  doc_bison_dvi = doc/bison.dvi
  $(doc_bison_dvi): $(FIGS_DOT:.dot=.eps)

and so on.  Automake does a simple string comparison of the target name
to decide whether or the generated rule is overridden, so using a
variable will hide the "real" target name from this check.  Note that
this is only appropriate for rules with no commands.

> (Note that in another branch we are using multiple Makefiles, and in
> that branch adding the previous lines to our doc/Makefile.am has the
> desired effect, though I am not sure why... is this a bug or a
> feature?)

Hard to say without looking a concrete example, but the most likely
explanation is that the Automake-generated rules are different in the
recursive case, such that your custom rules don't actually override
anything.

Hope that helps,
-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)




Information forwarded to bug-automake@HIDDEN:
bug#13104; Package automake. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Dec 2012 17:06:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 06 12:06:56 2012
Received: from localhost ([127.0.0.1]:57017 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TgeuV-0003jD-K6
	for submit <at> debbugs.gnu.org; Thu, 06 Dec 2012 12:06:56 -0500
Received: from eggs.gnu.org ([208.118.235.92]:56639)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <ranquet@HIDDEN>) id 1Tgdas-0001s4-Uq
	for submit <at> debbugs.gnu.org; Thu, 06 Dec 2012 10:42:36 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ranquet@HIDDEN>) id 1TgdaY-00066P-Cx
	for submit <at> debbugs.gnu.org; Thu, 06 Dec 2012 10:42:21 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,
	USER_IN_WHITELIST autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:52432)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ranquet@HIDDEN>) id 1TgdaY-00066J-9e
	for submit <at> debbugs.gnu.org; Thu, 06 Dec 2012 10:42:14 -0500
Received: from eggs.gnu.org ([208.118.235.92]:39713)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ranquet@HIDDEN>) id 1TgdaR-0004Og-2J
	for bug-automake@HIDDEN; Thu, 06 Dec 2012 10:42:14 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ranquet@HIDDEN>) id 1TgdaH-0005vR-3h
	for bug-automake@HIDDEN; Thu, 06 Dec 2012 10:42:06 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:52232
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ranquet@HIDDEN>) id 1TgdaG-0005pk-R9
	for bug-automake@HIDDEN; Thu, 06 Dec 2012 10:41:57 -0500
Received: from localhost ([127.0.0.1] helo=webmail.lrde.epita.fr)
	by kualalumpur.lrde.epita.fr with esmtp (Exim 4.63)
	(envelope-from <ranquet@HIDDEN>)
	id 1TgdZk-0002YL-Ci; Thu, 06 Dec 2012 16:41:24 +0100
Received: from 192.168.101.52 (SquirrelMail authenticated user ranquet)
	by webmail.lrde.epita.fr with HTTP;
	Thu, 6 Dec 2012 16:41:24 +0100 (CET)
Message-ID: <47897.192.168.101.52.1354808484.squirrel@HIDDEN>
Date: Thu, 6 Dec 2012 16:41:24 +0100 (CET)
Subject: Extending automake rules w.r.t dependencies
From: "Theophile Ranquet" <ranquet@HIDDEN>
To: bug-automake@HIDDEN
User-Agent: SquirrelMail/1.4.9a
MIME-Version: 1.0
Content-Type: multipart/mixed;boundary="----=_20121206164124_43539"
X-Priority: 3 (Normal)
Importance: Normal
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 06 Dec 2012 12:06:53 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

------=_20121206164124_43539
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

Hi,

I am seeking advice for a workaround of what seems like a limitation
in Automake (1.12.2).

We have recently added figures to Bison's documentation. These figures
are included by our texinfo source by using "@image", which requires
different image formats depending on what we want to produce. For
convenience's sake, these figures are generated from Graphviz DOT
files, so we tried adding the following to our doc/local.mk:

doc/bison.dvi:  $(FIGS_DOT:.dot=.eps)
doc/bison.html: $(FIGS_DOT:.dot=.png)
doc/bison.pdf:  $(FIGS_DOT:.dot=.pdf)

However, these overwrite Automake's rules. This seems a bit similar,
in that regard, to the issue discussed here:
http://lists.gnu.org/archive/html/automake/2012-11/msg00015.html

(Note that in another branch we are using multiple Makefiles, and in
that branch adding the previous lines to our doc/Makefile.am has the
desired effect, though I am not sure why... is this a bug or a
feature?)

The best solution we could come up with was to add these to
doc_bison_TEXINFOS, as follows, but this is a bit troublesome as it
causes the regeneration of all three filetypes whenever a
documentation is built, even when none is actually required (e.g. for
'make info' which uses .txt versions):

 doc_bison_TEXINFOS = \
   $(CROSS_OPTIONS_TEXI)                         \
   doc/fdl.texi                                  \
-  doc/gpl-3.0.texi
+  doc/gpl-3.0.texi                              \
+  $(FIGS_DOT:.dot=.eps)                         \
+  $(FIGS_DOT:.dot=.png)                         \
+  $(FIGS_DOT:.dot=.pdf)

If it is not possible to add custom dependencies to these Automake
rules, what whould you recommend doing?

FWIW, I have attached a diff showing the rules being overwritten by
the prior "solution".

Thanks!
------=_20121206164124_43539
Content-Type: text/x-patch; name="Makefile.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="Makefile.diff"

--- /tmp/Makefile	2012-12-06 15:33:29.469105426 +0100
+++ _build/Makefile	2012-12-06 16:35:35.772540139 +0100
@@ -2223,7 +2223,10 @@
 doc_bison_TEXINFOS = \
   $(CROSS_OPTIONS_TEXI)                         \
   doc/fdl.texi                                  \
-  doc/gpl-3.0.texi
+  doc/gpl-3.0.texi                              \
+  $(FIGS_DOT:.dot=.eps)                         \
+  $(FIGS_DOT:.dot=.png)                         \
+  $(FIGS_DOT:.dot=.pdf)
 
 TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d
 CLEANDIRS = doc/bison.t2d doc/figs doc/html
@@ -3989,6 +3992,30 @@
 	  $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
 	fi; \
 	rm -rf $$backupdir; exit $$rc
+
+doc/bison.dvi: doc/bison.texi $(srcdir)/doc/version.texi $(doc_bison_TEXINFOS) doc/$(am__dirstamp)
+	$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \
+	$(TEXI2DVI) $(AM_V_texinfo) --clean -o $@ `test -f 'doc/bison.texi' || echo '$(srcdir)/'`doc/bison.texi $(AM_V_texidevnull)
+
+doc/bison.pdf: doc/bison.texi $(srcdir)/doc/version.texi $(doc_bison_TEXINFOS) doc/$(am__dirstamp)
+	$(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \
+	$(TEXI2PDF) $(AM_V_texinfo) --clean -o $@ `test -f 'doc/bison.texi' || echo '$(srcdir)/'`doc/bison.texi $(AM_V_texidevnull)
+
+doc/bison.html: doc/bison.texi $(srcdir)/doc/version.texi $(doc_bison_TEXINFOS) doc/$(am__dirstamp)
+	$(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
+	$(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \
+	 -o $(@:.html=.htp) `test -f 'doc/bison.texi' || echo '$(srcdir)/'`doc/bison.texi; \
+	then \
+	  rm -rf $@; \
+	  if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
+	    mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
+	else \
+	  if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
+	    rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
+	  exit 1; \
+	fi
 $(srcdir)/doc/version.texi:  $(srcdir)/doc/stamp-vti
 $(srcdir)/doc/stamp-vti: doc/bison.texi $(top_srcdir)/configure
 	test -f doc/$(am__dirstamp) || $(MAKE) $(AM_MAKEFLAGS) doc/$(am__dirstamp)
@@ -5040,10 +5067,6 @@
 	fi
 	$(AM_V_at)rm -f $@*.t
 
-doc/bison.dvi:  $(FIGS_DOT:.dot=.eps)
-doc/bison.html: $(FIGS_DOT:.dot=.png)
-doc/bison.pdf:  $(FIGS_DOT:.dot=.pdf)
-
 .dot.eps:
 	$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
 	$(AM_V_at) $(DOT) -Gmargin=0 -Teps $< >$@.tmp

------=_20121206164124_43539--






Acknowledgement sent to "Theophile Ranquet" <ranquet@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-automake@HIDDEN. Full text available.
Report forwarded to bug-automake@HIDDEN:
bug#13104; Package automake. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.