help-make
[Top][All Lists]
Advanced

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

Re: Function to display variable values


From: Ken Smith
Subject: Re: Function to display variable values
Date: Fri, 5 Oct 2007 12:07:18 -0700

On 10/5/07, Michael Morrell <address@hidden> wrote:
> Is it possible to write a function that can display the value of an
> arbitrary variable?

I use this function.  I takes a list of variables and displays each
one.  As John also said, you can replace "warning" with "info" if you
are using 3.81.  Most of the time, I like to know the line number of
the show-vars invocation when I am debugging my makefiles so I use
"warning".

show-vars = \
$(strip \
  $(foreach .tmp,$(1), \
    $(warning $(.tmp)="$($(.tmp))") \
   ) \
 )

x := 1
y := 2
z := 3

$(call show-vars,x y z)

   Ken




reply via email to

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