| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile.kern.inc,v 1.129 2011/01/04 01:52:30 matt Exp $ | | 1 | # $NetBSD: Makefile.kern.inc,v 1.130 2011/02/17 18:47:13 matt Exp $ |
2 | # | | 2 | # |
3 | # This file contains common `MI' targets and definitions and it is included | | 3 | # This file contains common `MI' targets and definitions and it is included |
4 | # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. | | 4 | # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. |
5 | # | | 5 | # |
6 | # Each target in this file should be protected with `if !target(target)' | | 6 | # Each target in this file should be protected with `if !target(target)' |
7 | # or `if !commands(target)' and each variable should only be conditionally | | 7 | # or `if !commands(target)' and each variable should only be conditionally |
8 | # assigned `VAR ?= VALUE', so that everything can be overriden. | | 8 | # assigned `VAR ?= VALUE', so that everything can be overriden. |
9 | # | | 9 | # |
10 | # DEBUG is set to -g if debugging. | | 10 | # DEBUG is set to -g if debugging. |
11 | # PROF is set to -pg if profiling. | | 11 | # PROF is set to -pg if profiling. |
12 | # | | 12 | # |
13 | # To specify debugging, add the config line: makeoptions DEBUG="-g" | | 13 | # To specify debugging, add the config line: makeoptions DEBUG="-g" |
14 | # A better way is to specify -g only for a few files. | | 14 | # A better way is to specify -g only for a few files. |
| @@ -239,26 +239,32 @@ LINKFLAGS_DEBUG?= -X | | | @@ -239,26 +239,32 @@ LINKFLAGS_DEBUG?= -X |
239 | SYSTEM_LD_TAIL_DEBUG?=; \ | | 239 | SYSTEM_LD_TAIL_DEBUG?=; \ |
240 | echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \ | | 240 | echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \ |
241 | echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \ | | 241 | echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \ |
242 | ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb | | 242 | ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb |
243 | LINKFLAGS_NORMAL?= -S | | 243 | LINKFLAGS_NORMAL?= -S |
244 | STRIPFLAGS?= -g | | 244 | STRIPFLAGS?= -g |
245 | | | 245 | |
246 | DEBUG?= | | 246 | DEBUG?= |
247 | .if !empty(DEBUG:M-g*) | | 247 | .if !empty(DEBUG:M-g*) |
248 | SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_DEBUG} | | 248 | SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_DEBUG} |
249 | LINKFLAGS+= ${LINKFLAGS_DEBUG} | | 249 | LINKFLAGS+= ${LINKFLAGS_DEBUG} |
250 | EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gdb@} | | 250 | EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gdb@} |
251 | CTFFLAGS+= -g | | 251 | CTFFLAGS+= -g |
| | | 252 | SYSTEM_LD_TAIL+=; \ |
| | | 253 | if grep '^\#define.*SYMTAB_SPACE' opt_ddbparam.h > /dev/null; then \ |
| | | 254 | echo "${DBSYM} $@.gdb"; \ |
| | | 255 | ${DBSYM} $@.gdb; \ |
| | | 256 | fi |
| | | 257 | |
252 | .elifndef PROF | | 258 | .elifndef PROF |
253 | LINKFLAGS+= ${LINKFLAGS_NORMAL} | | 259 | LINKFLAGS+= ${LINKFLAGS_NORMAL} |
254 | .endif | | 260 | .endif |
255 | | | 261 | |
256 | SYSTEM_LD_TAIL+=; \ | | 262 | SYSTEM_LD_TAIL+=; \ |
257 | if grep '^\#define.*SYMTAB_SPACE' opt_ddbparam.h > /dev/null; then \ | | 263 | if grep '^\#define.*SYMTAB_SPACE' opt_ddbparam.h > /dev/null; then \ |
258 | echo "${DBSYM} $@"; \ | | 264 | echo "${DBSYM} $@"; \ |
259 | ${DBSYM} $@; \ | | 265 | ${DBSYM} $@; \ |
260 | fi | | 266 | fi |
261 | | | 267 | |
262 | SYSTEM_LD_HEAD+=${SYSTEM_LD_HEAD_EXTRA} | | 268 | SYSTEM_LD_HEAD+=${SYSTEM_LD_HEAD_EXTRA} |
263 | SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_EXTRA} | | 269 | SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_EXTRA} |
264 | | | 270 | |