This pairmap
function takes three arguments:
For each zipped tuple in the lists it will call the function with the following arguments:
It will expand to a space-separated list of the function expansions.
list-rem = $(wordlist 2,$(words $1),$1)
pairmap = $(and $(strip $2),$(strip $3),$(call \
$1,$(firstword $2),$(firstword $3)) $(call \
pairmap,$1,$(call list-rem,$2),$(call list-rem,$3)))
For example, this:
LIST1 := foo bar baz
LIST2 := 1 2 3
func = $1-$2
all:
@echo $(call pairmap,func,$(LIST1),$(LIST2))
.PHONY: all
Will print foo-1 bar-2 baz-3
.