I am trying to use GNU Make's substitution reference, but I need to refer to the % twice in the substitution. And it is not working the way I expected. Here is my Makefile:
foo := io protocol util
bar := $(foo:%=../Lib%/obj/lib%.a)
default: ; @echo bar = $(bar)
I want end up with:
bar = ../Libio/obj/libio.a ../Libprotocol/obj/libprotocol.a ../Libutil/obj/libutil.a
But this is what I end up with:
../Libio/obj/lib%.a ../Libprotocol/obj/lib%.a ../Libutil/obj/lib%.a```
I've read the GNU Make reference manual, and I don't see any mention or examples of using % twice in one statement. I don't even know if it is possible.
Any help would be greatly appreciated.