help-make
[Top][All Lists]
Advanced

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

Re: Function to display a command without expanding variables


From: John Graham-Cumming
Subject: Re: Function to display a command without expanding variables
Date: Fri, 05 Oct 2007 21:52:49 +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

Michael Morrell wrote:
> I'm trying to write a function that will let me display a command without
> expanding the variables.
> 
> This way, I can write:
> 
> x = 1
> y = 2
> 
> all:
>      $(call show-cmd, echo $(x) $(y))
> 
> and have the output be:
> 
> echo $(x) $(y)
> 1 2
> 
> That is, I want to see the command I am executing but I want it in a
> "symbolic" form.


You can't do that directly with a $(call) because $(call) expands it's
arguments before they are passed to the function.   You could do
something like

a = echo $(x) $(y)

and then use $(value a) to get the unexpanded string.   What are you
actually trying to achieve?

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

iD8DBQFHBpYRLphrp73n/hARArAjAKDW/DnuobFCdJQVn+ULECLxW5HuOgCgyVsC
9zFtnT7eoPGhgwWvpBpZeH4=
=23Kz
-----END PGP SIGNATURE-----




reply via email to

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