如果你有一系列命令可用作多个目标的配方,那么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’罐头食谱’有参数吗?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)