将构建后行写入 makefile
我希望在每次“make”后自动将多个文件从“folderA”复制到“folderB”。
有谁知道如何将构建后行添加到 makefile 中?
I would like several files to be copied from "folderA" to "folderB" automatically after each "make".
Does anyone know how to add a post-build line into the makefile?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将类似的内容添加到默认
make
目标的末尾(makefile 中的第一个目标始终是默认目标):如果您想要更复杂的内容,请查看
man install
和man cp
。You could add something like this to the end of your default
make
target (the first target in the makefile is always the default):If you want something more complicated, have a look at
man install
andman cp
.通常,这将是一个依赖于可执行文件构建的
安装
目标。它通常使用 cp 或 install 命令来复制文件。这里的示例说明了这一点。
Normally this would be an
install
target that is dependent on the build of the executable. It typically uses thecp
orinstall
commands to copy the files.Here's an example that illustrates this.