| | 84 | |
| | 85 | = Makefile = |
| | 86 | * [http://www.unix.com/shell-programming-scripting/96486-makefile-debug-target.html Makefile debug target - The UNIX and Linux Forums] |
| | 87 | > Call the same makefile recursively in the debug target including the required flags. Don't set $(DEBUG) as a macro, but pass it in on the recursive call. Something like... |
| | 88 | > {{{ |
| | 89 | > (snip) |
| | 90 | > |
| | 91 | > debug: |
| | 92 | > $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG" |
| | 93 | > }}} |
| | 94 | * [http://stackoverflow.com/questions/1079832/how-can-i-configure-my-makefile-for-debug-and-release-builds make - How can I configure my makefile for debug and release builds? - Stack Overflow] |
| | 95 | > You can use [http://www.gnu.org/software/make/manual/make.html#Target%5F002dspecific Target-specific Variable Values]. Example: |
| | 96 | > {{{ |
| | 97 | > (snip) |
| | 98 | > debug: CXX += -DDEBUG -g |
| | 99 | > debug: CC += -DDEBUG -g |
| | 100 | > debug: executable |
| | 101 | > }}} |