help-make
[Top][All Lists]
Advanced

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

Re: $(foo) vs $(call foo)


From: John Graham-Cumming
Subject: Re: $(foo) vs $(call foo)
Date: Wed, 27 Jun 2007 15:26:47 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040208 Thunderbird/0.5 Mnenhy/0.6.0.104

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephan Beal wrote:
> is there a semantic difference between:
> 
>   foo:
>       $(my-macro)
> 
> and:
> 
>   foo:
>       $(call my-macro)

There's a slight performance penalty for doing $(call my-macro) instead
of $(my-macro), but it's very small.

If you like to walk on the wild side then there is another difference,
but I'm warning you that this difference is only for people who are
doing extreme things with GNU Make.

In this article http://www.cmcrossroads.com/content/view/6529/120/ I
talk about the fact that when you do $(call foo) the recursion checking
flag (that prevents you doing something like foo = $(foo)...) is reset.
 This means that you can make a variable refer to itself by doing
something like foo = $(call foo) (don't actually do that because you'll
crash GNU Make), but this did come in handy when I was making my GNU
Make Debugger project for reason discussed in the article above.

Again, that's only for people who like to play with fire.

John.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGgmWXLphrp73n/hARAv1DAKCJY8Rv0WgwB2dSj0mhuPUa9bRlSQCgncXF
y8XVM83m0+hsFGZmirRuSOA=
=D007
-----END PGP SIGNATURE-----




reply via email to

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