开发者

How to pass -g3 flag to GCC via Make command line? [duplicate]

This question already has an answer here: Add compiler option without editing Makefile (1 answer) Closed 7 years ago.

My project compiled with -g option instead of -g3, which means that I can't expand macros in gdb. I want to add the -g3 flag to GCC, but I don't want to modify the makefile, I just want to add this flag via the Make command line.

How can I do i开发者_运维知识库t?


That depends on what the Makefile does/how it was written. It might not be possible.

If your Makefile is reasonably "standard", then this should work:

make CFLAGS="-g3 ..."

If it's for C++:

make CXXFLAGS="-g3 ..."
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜