Makefile output folder

≡放荡痞女 提交于 2021-02-17 05:45:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!