views:

22

answers:

1

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
+2  A: 

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

Arthur Shipkowski