Hi. I was wondering, I have a make file which I use to compile my c++ project in ubuntu linux and every time I compile I have to copy and paste the binary to several locations in my file system for testing.
So is there a way to tell the make file to produce the same binary several times in different directories?
copies={another,yet_another,one_more}.bin
program.bin: $(objects)
#compilation
for i in $(copies); do ln -f program.bin $$i; done #note that they are hard links
clean:
rm $(copies)
I have to copy and paste the binary to several locations in my file system for testing.
That doesn't sound right.
If Mohammed will not go to the mountain...
Hi. I was wondering, I have a make file which I use to compile my c++ project in ubuntu linux and every time I compile I have to copy and paste the binary to several locations in my file system for testing.
Have you considered, instead of copying it to several locations, putting a link in each of those location to wherever you have the actual built executable?
You can do it as follows:
Change directory to wherever you current have a copy, rm that copy, and softlink to the compiled one. ln -s /yourBuildDirectory/mayebSomeSubPath/nameOfExecutable ./