Makefile make文件中目标名称中涉及的模式

Makefile make文件中目标名称中涉及的模式,makefile,Makefile,我想为服务器列表执行多个目标。从makefile输出来看,似乎只有$(服务器)目标执行了两次。我想执行两次。我怎样才能使它工作。如何访问目标启动-%中的每个IP地址?请帮帮我。我有下面的make文件源代码和输出。提前谢谢 Makefile source code: SERVERS=172.16.0.17 172.16.0.100 test-all: test-port-connectivity test-port-connectivity: Launch-$(SERVERS) e

我想为服务器列表执行多个目标。从makefile输出来看,似乎只有$(服务器)目标执行了两次。我想执行两次。我怎样才能使它工作。如何访问目标启动-%中的每个IP地址?请帮帮我。我有下面的make文件源代码和输出。提前谢谢

Makefile source code:
SERVERS=172.16.0.17 172.16.0.100
test-all: test-port-connectivity
test-port-connectivity: Launch-$(SERVERS)
        echo "Test suit 1: Port Connectivity $<"

Launch-%: $(SERVERS)
        echo "Launch Server $<"

$(SERVERS):
        echo "Server IP - $@"

Output of Makefile:
# make 
echo "Server IP - 172.16.0.17"
Server IP - 172.16.0.17
echo "Server IP - 172.16.0.100"
Server IP - 172.16.0.100
echo "Launch Server 172.16.0.17"
Launch Server 172.16.0.17
echo "Test suit 1: Port Connectivity Launch-172.16.0.17"
Test suit 1: Port Connectivity Launch-172.16.0.17
Makefile源代码:
服务器=172.16.0.17 172.16.0.100
全部测试:测试端口连接
测试端口连接:启动-$(服务器)
echo“测试套件1:端口连接$
服务器=172.16.0.17 172.16.0.100
Launchs=$(addprefix Launch-,$(SERVERS))#这将是Launch-172.16.0.17 Launch-172.16.0.100
全部测试:测试端口连接
测试端口连接:$(启动)
echo“测试套件1:端口连接$^”
$(发布):发布-%:%

echo“Launch recipe中的Launch Server$我生成了另一个运行时列表,我想处理它,类似于$(服务器)列表。有什么方法可以将控制权从$(启动)配方转移到文件中的其他目标吗?@ashinde:我不明白你的问题。你想完成什么?抱歉,贝塔没有说清楚。由于文本限制,我对此提出了新问题。这是链接“”
SERVERS=172.16.0.17 172.16.0.100
LAUNCHES=$(addprefix Launch-, $(SERVERS)) # this will be Launch-172.16.0.17 Launch-172.16.0.100

test-all: test-port-connectivity
test-port-connectivity: $(LAUNCHES)
    echo "Test suit 1: Port Connectivity $^"

$(LAUNCHES): Launch-%: %
    echo "Launch Server $<"

$(SERVERS):
    echo "Server IP - $@"