GCC dependency generation for a different output directory

后端 未结 7 509
深忆病人
深忆病人 2021-01-30 14:30

I\'m using GCC to generate a dependency file, but my build rules put the output into a subdirectory. Is there a way to tell GCC to put my subdirectory prefix in the dependency f

7条回答
  •  萌比男神i
    2021-01-30 14:54

    1. [GNU] make gets angry if you don't place the output in the current directory. You should really run make from the build directory, and use the VPATH make variable to locate the source code. If you lie to a compiler, sooner or later it will take its revenge.

    2. If you insist on generating your objects and dependencies in some other directory, you need to use the -o argument, as answered by Emile.

提交回复
热议问题