Makefile:can’罐头食谱’有参数吗?

Makefile:can’罐头食谱’有参数吗?,第1张

概述我的问题涉及GNU的制作. 如果你有一系列命令可用作多个目标的配方,那么canned recipe就派上用场了.我可能看起来像这样: define run-foo# Here comes a# sequence of commands that are# executed line by lineendef 现在您可以像这样使用罐装配方: file1: input1: $(run- 我的问题涉及GNU的制作.

如果你有一系列命令可用作多个目标的配方,那么canned recipe就派上用场了.我可能看起来像这样:

define run-foo# Here comes a# sequence of commands that are# executed line by lineendef

现在您可以像这样使用罐装配方:

file1: input1:    $(run-foo)$(pattern) : sub/% : %.inp    $(run-foo)

等等.我想知道是否可以定义带参数的罐装食谱(或类似的东西),以便我可以像这样执行它们:

file2: input2    $(run-foo) specific-parameter2 "additional"file3: input3    $(run-foo) another-parameter3 "text"

这可能吗?任何提示欢迎:)

解决方法 你这样做:

>在定义宏中使用参数$1,$2 …等
>通过$调用宏(调用…)

例如:

define recipeecho endefall: t1 t2t1:    $(call recipe,"One")t2:    $(call recipe,"Two")
总结

以上是内存溢出为你收集整理的Makefile:can’罐头食谱’有参数吗?全部内容,希望文章能够帮你解决Makefile:can’罐头食谱’有参数吗?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1242957.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-06
下一篇 2022-06-06

发表评论

登录后才能评论

评论列表(0条)

保存