开发者

Makefile, modify list

开发者 https://www.devze.com 2023-01-07 08:01 出处:网络
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.

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

精彩评论

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

关注公众号