make-alpha
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: addsuffix manual example wrong, se_implicit test 4 fails.


From: Paul Smith
Subject: Re: addsuffix manual example wrong, se_implicit test 4 fails.
Date: Thu, 18 Sep 2014 09:50:32 -0400

On Wed, 2014-09-17 at 20:34 -0500, John E. Malmberg wrote:
> This was noticed on make help in 2010.
> 
> http://gnu-make.2324884.n4.nabble.com/There-is-a-bug-in-the-make-manual-td11187.html
> 
> In the section on Secondary Expansion of Implicit Rules:
> 
> In this example:
> 
>       .SECONDEXPANSION:
> 
>       /tmp/foo.o:
> 
>       %.o: $$(addsuffix /%.c,foo bar) foo.h
>               @echo $^
> 
> It is claimed that $$(addsuffix /%c,foo bar) for the stem '/tmp/foo' 
> will expand to '/tmp/foo/foo.c /tmp/bar/foo.c'.

It will.

> It actually expands to 'foo//tmp/foo.c bar//tmp/foo.c', which means the 
> example does not work.
> 
> I tested this behavior with make 3.81 on Ubuntu 14.04 LTS.

GNU make 3.81 was released in 2006 and has many known bugs.  It should
not be used for testing proper behavior of more advanced features like
secondary expansion, etc.

Most especially you need to be careful when using the online version of
the manual from gnu.org, since that documents the current latest release
and older releases may not work the same way in all cases.

> This same example is test #4 in the se_implicit test, and it is failing 
> for me on the Make 4.0.0.

It works fine for me in GNU make 4.0 on Linux Mint 17 (basically Ubuntu
14.04) (actually this is from the current Git head but I'm pretty sure
nothing in this area has changed since the 4.0 release):

  $ mkdir /tmp/foo /tmp/bar
  $ touch /tmp/foo/foo.c /tmp/bar/foo.c
  $ touch foo.h

  $ cat Makefile
  .SECONDEXPANSION:

  /tmp/foo.o:

  %.o: $$(addsuffix /%.c,foo bar) foo.h ; @echo $^

  $ make
  /tmp/foo/foo.c /tmp/bar/foo.c foo.h




reply via email to

[Prev in Thread] Current Thread [Next in Thread]