-   Programming (
-   -   add "-g" gcc compile option to makefiles (

powah 08-10-2007 08:45 AM

add "-g" gcc compile option to makefiles
HOW to add the "-g" gcc compile option to makefiles so that I choose whether to compile for debuggging or not?
make release
make debug

However, this requires modifying all the makefiles to add the "debug" target.
Currently we build only the "release" target.
Is there a easier way (which does not requires modifying all the makefiles)? 08-11-2007 01:28 AM

Try this:

CFLAGS="-g" make release
This only works if you don't set CFLAGS within your makefiles. If you already do that, and it's always set to the same value, you can still do what you want. If, for example, you already set CFLAGS to -O3, try this:

CFLAGS="-O3 -g" make release
Hope this helps.

All times are GMT -5. The time now is 03:25 AM.