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:
        -@echo ">"$(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




_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to