Generate text for each item in a list.
Section: Wildcards and file discovery
foreach list expansion
makefile
makefile
PKG_TARGETS := $(foreach p,$(PACKAGES),test-$(p))Explanation
A powerful building block for metaprogramming.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Wildcards and file discovery