I want to generate a list of equivalent targets:
TARGETLIST = a b c d e f
define RULE
$(subst X,$(1),file_X.txt) $(subst X,$(1),otherfile_X.txt) &: # some dependency
# some commands
endef
$(foreach _t, $(TARGETLIST), $(eval $(call RULE, $(_t))))
This does not do what I want: If I want to build file_b.txt
for example the recipe is not found. How do I fix this?