开发者

Makefile, modify list

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 cr开发者_StackOverfloweate
DIRS_INCLUDE=-IA -IB -IC -ID


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜