通过读取另一个文件的内容,在makefile中创建一个变量(Create a variable in a makefile by reading contents of another file)

编程入门 行业动态 更新时间:2024-10-25 23:24:07
通过读取另一个文件的内容,在makefile中创建一个变量(Create a variable in a makefile by reading contents of another file)

如何从makefile创建一个变量,其值将是另一个数据文件的全部内容。

How can I create a variable on-the-fly from makefile, the value of which would be the entire contents of another data file.

最满意答案

我猜你想在Makefile中设置一个变量到另一个文件的内容:

FILE=test.txt VARIABLE=`cat $(FILE)` target: echo $(VARIABLE)

I'm guessing that you like to set a variable in your Makefile to the contents of another file:

FILE=test.txt VARIABLE=`cat $(FILE)` target: echo $(VARIABLE)

更多推荐

本文发布于:2023-07-14 23:40:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1108345.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:创建一个   变量   文件   内容   makefile

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!