作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要用像这样的名字来构建目标,
v1/thread4/foo v1/thread8/foo v1/thread16/foo
v2/thread4/foo v2/thread8/foo v2/thread16/foo
我想匹配 thread% 和 v%,因为对于我的代码,threadNum=?和版本=?是编译时需要定义的宏。所以在结果中,我希望得到这样的布局,foo 是可执行文件的名称
v1-|thead4/foo
|thead8/foo
|thead16/foo
v2-|thead4/foo
|thead8/foo
|thead16/foo
各种方法都试过了,还是不行
%/%/foo: foo.cc $(HEADERS)
$(CXX) $(CXXFLAGS) -DTHREAD=$* -o $@ $< $(LDLIBS)
最佳答案
当你意识到 $@
是 v1/thread4/foo
时就很容易了(比方说),然后拉出你需要的部分。
在这种情况下,类似于:
v = $(firstword $(subst /, ,$@))
thread = $(notdir ${@D})
当然是 YMMV。导致
targets := \
v1/thread4/foo v1/thread8/foo v1/thread16/foo \
v2/thread4/foo v2/thread8/foo v2/thread16/foo
all: ${targets}
v = $(firstword $(subst /, ,$@))
thread = $(notdir ${@D})
${targets}:
: '$@: v [$v] thread [${thread}]'
给予
$ make
: 'v1/thread4/foo: v [v1] thread [thread4]'
: 'v1/thread8/foo: v [v1] thread [thread8]'
: 'v1/thread16/foo: v [v1] thread [thread16]'
: 'v2/thread4/foo: v [v2] thread [thread4]'
: 'v2/thread8/foo: v [v2] thread [thread8]'
: 'v2/thread16/foo: v [v2] thread [thread16]'
关于makefile - 如何匹配目标中的双词干,如 %/% 或其他方式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58404646/
我想搜索一个单词及其在句子中的变体。例如,单词“happy”的变体是“happiest”、“happier”。有java库支持吗? 最佳答案 您可以使用Porter stemming algorith
愚蠢的,但我无法访问 NLTK 中的主干函数。 我打电话 import nltk nltk.stem.porter.step1ab() 但我被告知该对象没有 step1ab 属性。我想我以某种方式没有
我想将 DataFrame 的列和索引限制为这样的内容 ps = PorterStemmer() df_dic = pd.read_csv('inquirerbasic_clean.csv', sep
查看以下脚本tortest.py,它反复切换TOR电路并检查IP地址是否已更改: #!/usr/bin/env python2.7 # -*- coding: utf-8 -*- import jso
我是一名优秀的程序员,十分优秀!