How to pass -g3 flag to GCC via Make command line? [duplicate]
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 ..."
精彩评论