问题
I have a makefile and all I want to do is to make my executable go to the folder created in the one I have all the files in. So let's say I have a folder in which there are some .cpp files, I create a folder in this folder called OUTPUT (during compilation) and I want my exec made out of those cpp files to go into this folder.
How do i do that?
Thanks in advance!
回答1:
OUTPUT/exec: foo.cpp bar.cpp baz.cpp
g++ $^ -o $@
Refinements are possible, but this will get you started.
来源:https://stackoverflow.com/questions/15677308/makefile-output-folder