Post-build line into makefile
-
21-02-2021 - |
Pergunta
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?
Solução
You could add something like this to the end of your default make
target (the first target in the makefile is always the default):
install folderA/{file1,file2,file3} folderA/*.foo folderB
If you want something more complicated, have a look at man install
and man cp
.
Outras dicas
Normally this would be an install
target that is dependent on the build of the executable. It typically uses the cp
or install
commands to copy the files.
Here's an example that illustrates this.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow