gpt4 book ai didi

makefile - 如何在 Makefile 中使用自动变量获取第二个依赖文件?

转载 作者:行者123 更新时间:2023-12-03 07:40:16 25 4
gpt4 key购买 nike

我需要从规则中获取第 n 个依赖文件,类似于 bash 中的 $n 。我需要这个,因为我想将各个依赖文件作为构建程序的选项提供。

这是一个例子:

dep.o: dep.src config1.cfg config2.cfg
parse -cfg1 $2 -cfg2 $3 -o $@ $<

可能吗?

最佳答案

dep.o: dep.src config1.cfg config2.cfg
@echo the second preq is $(word 2,$^), the third is $(word 3,$^)

关于makefile - 如何在 Makefile 中使用自动变量获取第二个依赖文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11424204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com