从Makefile变量中删除项目? [英] Remove item from a Makefile variable?
本文介绍了从Makefile变量中删除项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个makefile,其中包括其他几个makefile,这些文件又都添加到这样的变量中:
I have a makefile, which includes several other makefiles, which in turn all add to a variable like this:
VAR := Something SomethingElse
VAR += SomeOtherThing
(...)
现在,我希望从VAR
变量中删除SomethingElse
.我要代替(...)
做什么呢?
Now I wish to remove SomethingElse
from the VAR
variable. What do I put in place of (...)
to do this?
我正在使用GNU Make,GNU Make的特定解决方案就可以了.
I am using GNU Make, and a GNU Make specific solution will be fine.
推荐答案
您可以使用 filter-out
文本函数(如果您使用的是GNU Make).
You could use the filter-out
text function if you're using GNU Make.
OTHERVAR := $(filter-out SomethingElse,$(VAR))
这篇关于从Makefile变量中删除项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文