On 05/31/2012 04:32 PM, Akim Demaille wrote:
> 
> Le 30 mai 2012 à 13:05, Stefano Lattarini a écrit :
> 
>> +## FIXME: Extra indirection required because Automake preprocessing groups
> 
> preprocessing
> 
>> +## FIXME: dependencies for a given '*-am' together, so that we might end up
>> +## FIXME: in our genereated Makefile with something like:
>> +## FIXME:
>> +## FIXME:   install-pdf-am: $(PDFS) install-pdf-local
>> +## FIXME:           ... [RECIPE] ...
>> +## FIXME: 
>> +## FIXME: which would cause a huge mess with our usages of '$^' in the 
>> recipes.
>
Actually, this is not Automake fault; even upon reading:

  install-pdf-am: $(PDFS)
        [RECIPE]

  install-pdf-am: install-pdf-local

GNU make would expand '$^' to "$(PDFS) install-pdf-local" in the recipe; this
is likely considered a feature, not a bug:

  <http://lists.gnu.org/archive/html/help-make/2012-05/msg00029.html>

So I've pushed the attached patch to fix the incorrect comment and clarify the
situation.

> Other than that, looks good.  Nice use of $(and).
> 
> 

Thanks,
  Stefano
>From 165c66c01fc0db7654de590a46099ed915c3d8a6 Mon Sep 17 00:00:00 2001
Message-Id: <165c66c01fc0db7654de590a46099ed915c3d8a6.1338638121.git.stefano.lattar...@gmail.com>
From: Stefano Lattarini <[email protected]>
Date: Sat, 2 Jun 2012 13:55:15 +0200
Subject: [PATCH] texinfo: fix an imprecise comment

In GNU make, '$^' used in a recipe contains every dependency for the
target, even those not declared when the recipe is read; for example,
on:

    all: foo1; @echo $^
    all: foo2

"make all" would output "foo1 foo2".  This is not Automake's fault,
as some comments incorrectly stated.  See also:
<http://lists.gnu.org/archive/html/help-make/2012-05/msg00029.html>

* lib/am/texinfos.am: Fix those incorrect comments, and document the
GNU make behaviour described above.

Signed-off-by: Stefano Lattarini <[email protected]>
---
 lib/am/texinfos.am |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am
index afe08a1..fc3981a 100644
--- a/lib/am/texinfos.am
+++ b/lib/am/texinfos.am
@@ -136,14 +136,16 @@ if %?LOCAL-TEXIS%
 
 include inst-vars.am
 
-## FIXME: Extra indirection required because Automake proprocessing groups
-## FIXME: dependencies for a given '*-am' together, so that we might end up
-## FIXME: in our genereated Makefile with something like:
-## FIXME:
-## FIXME:   install-pdf-am: $(PDFS) install-pdf-local
-## FIXME:           ... [RECIPE] ...
-## FIXME: 
-## FIXME: which would cause a huge mess with our usages of '$^' in the recipes.
+# In GNU make, '$^' used in a recipe contains every dependency for the
+# target, even those not declared when the recipe is read; for example,
+# on:
+#    all: foo1; @echo $^
+#    all: foo2
+# "make all" would output "foo1 foo2".  In our usage, a dependecy like
+# "install-pdf-am: install-pdf-local" (that is automatically output by
+# Automake-NG if the 'install-pdf-local' target is declared) would make
+# '$^' unusable as a pure list of PDF target files in the recipe of
+# 'install-pdf-am'.  So we need the following indirections.
 
 install-dvi-am:  am--install-dvi
 install-ps-am:   am--install-ps
-- 
1.7.9.5

Reply via email to