如何在目标中匹配双茎,如%/%或其他方式?

问题描述 投票:0回答:1

我需要使用类似名称的目标来构建目标,>

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 v1 / thread8 / foo v1 / thread16 / foo v2 / thread4 / foo v2 / thread8 / foo v2 / thread16 / foo之类的名称构建目标,我想将线程%和v进行匹配%,因为对于我的代码,...

makefile gnu-make
1个回答
0
投票

[在GNU make中没有多种模式。

© www.soinside.com 2019 - 2024. All rights reserved.