开发者

Removing values from Make Variables

开发者 https://www.devze.com 2023-02-16 22:22 出处:网络
Using GNU Make I want to remove values from a variable: VAR := x.c y.c z.c <snip> VAR += x_x.c y_y.c

Using GNU Make I want to remove values from a variable:

VAR := x.c y.c z.c
<snip>
VAR += x_x.c y_y.c

I now want to remove the "x.c" and "开发者_开发问答y.c" from the variable. I have tried using subst command but the x_x.c is removed as well.

Are there any ways of doing this?

The final variable should look like:

VAR = z.c x_x.c y_y.c


You want the filter-out function:

VAR := $(filter-out x.c y.c,$(VAR))
0

精彩评论

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

关注公众号