help-make
[Top][All Lists]
Advanced

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

Re: if function combined with filter or findstring with eval


From: Paul Smith
Subject: Re: if function combined with filter or findstring with eval
Date: Thu, 20 Oct 2016 17:34:22 -0400

On Thu, 2016-10-20 at 15:22 -0600, Scott Kruger wrote:
>    FOO:=$(foreach rarg, $(RUNTESTS_ARGS), $(if $(findstring 
> $(argsearch),$(eval $(value rarg))), $(rarg)))

I don't understand what you're trying to do, but definitely eval is not
what you want to use, at least not where you're using it.

The result of expanding the eval function is ALWAYS the empty string,
so findstring will never find anything in it and your if statement will
never be true.

The reason eval gives that error is that it expects its argument to be
a valid makefile stanza.  As always when playing with eval, if you
don't understand what's going on you should replace the eval with info,
and make will print the output that it would try to eval:

  ... $(info $(value rarg))...

you'll see output like:

  "foo"
  "bar"
  "foo bar"

which are the values of various arguments.  But those are not valid
makefile lines, hence your error.

If you explained more clearly what you're trying to do we can better
help you.



reply via email to

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