[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
if function combined with filter or findstring with eval
From: |
Scott Kruger |
Subject: |
if function combined with filter or findstring with eval |
Date: |
Thu, 20 Oct 2016 15:22:17 -0600 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
I am trying to construct a simple list of variables
whose values match certain patterns. It seems
straightforward, but I can't get the righ t
The makefile is:
----------
RUNTESTS=runex1 runex2 runex3
RUNTESTS_ARGS=$(foreach runtest, $(RUNTESTS), $(runtest)_ARGS)
ifdef argsearch
FOO:=$(foreach rarg, $(RUNTESTS_ARGS), $(if $(findstring
$(argsearch),$(eval $(value rarg))), $(rarg)))
else
FOO:=$(RUNTESTS_ARGS)
endif
all:
address@hidden ">"$(FOO)
runex1_ARGS="foo"
runex2_ARGS="bar"
runex2_ARGS="foo bar"
----------
I get missing separator error on the line with the
findstring when I try `make argsearch="foo"`
I know it's the eval function that is causing the
problem, but trying various eval/value/$$ permutations
is not fixing it. I'm very confused here and would
appreciate help.
Thanks,
Scott
- if function combined with filter or findstring with eval,
Scott Kruger <=