简体   繁体   English

将生成后的行放入makefile

[英]Post-build line into makefile

I would like several files to be copied from "folderA" to "folderB" automatically after each "make". 我希望在每个“ make”之后自动将几个文件从“ folderA”复制到“ folderB”。

Does anyone know how to add a post-build line into the makefile? 有谁知道如何在生成文件中添加构建后代码行?

You could add something like this to the end of your default make target (the first target in the makefile is always the default): 您可以在默认make目标的末尾添加这样的内容(makefile中的第一个目标始终是默认目标):

install folderA/{file1,file2,file3} folderA/*.foo folderB

If you want something more complicated, have a look at man install and man cp . 如果您想要更复杂的东西,请查看man installman cp

Normally this would be an install target that is dependent on the build of the executable. 通常,这将是一个取决于可执行文件生成的install目标。 It typically uses the cp or install commands to copy the files. 它通常使用cpinstall命令来复制文件。

Here 's an example that illustrates this. 是一个说明这一点的例子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM