Automatic dependency generation and compilation in non-flat directory src

江枫思渺然 提交于 2019-12-13 07:29:06

问题


I'd like to adapt the combined automatic dependency approach to a non-flat directory situation where headers are located under ./include/ and implementation files under ./src/ (while Makefile is in the current directory .). I'd like to hold all intermediate and .d (dependency) files inside a separate directory (potentially separate ./build/ and ./.deps/) . To avoid potential clash for dependency files when more than one file with the same name in different subdirectories of ./include/ and ./src/ can exist, I guess building the same structure as in ./src/ in ./.deps could be a solution.

Apart from adding -I directive to the compile phase in the above linked Makefile, what else should I add?

来源:https://stackoverflow.com/questions/41045406/automatic-dependency-generation-and-compilation-in-non-flat-directory-src

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