here is a snippet from my makefile:
main_DEPS = $(TARGETS_$(d)/classes/player) $(TARGETS_$(d)/classes/monster)
It sets main_DEPS to the expanded versions of the other two variables.
This works as it should.
How can I replace:
$(TARGETS_$(d)/classes/player) $(TARGETS_$(d)/classes/monster)
with a program that gives the same output?
I tried:
main_DEPS = $(shell program)
but it appeared to set main_DEPS equal to the string value $(TARGETS_$(d)/classes/player) $(TARGETS_$(d)/classes/monster), not the expanded versions.
I’ve also tried:
main_DEPS = $(eval $(shell program))
main_DEPS = $(value $(shell program))
main_DEPS = $(value $(eval $(shell program)))
main_DEPS = $(eval $(value $(shell program)))
Did you try this:
Here, the argument of
eval(inner expression withshell) is expanded to get the statement to evaluate:If I properly understand, this should be exactly what you want.