Reputation: 60802
If I have a list in a GNU Makefile, is it possible to create a new list with the original strings modified. This is would be perfect if there was the map
higher-order procedure from some languages.
This is an example of what I'm trying to do
DIRS=A B C D
#apply some magic to create
DIRS_INCLUDE=-IA -IB -IC -ID
Upvotes: 5
Views: 1305
Reputation: 3666
Since you've said it's GNU Make:
DIRS_INCLUDE=$(foreach dir,$(DIRS),-I$(dir))
See http://www.gnu.org/software/make/manual/html_node/Foreach-Function.html#Foreach-Function
Upvotes: 5