Module Name:    src
Committed By:   christos
Date:           Thu Dec 30 18:53:35 UTC 2021

Modified Files:
        src/sys/conf: Makefile.kern.inc

Log Message:
- With DEBUG=-g (which is also set when we build CTF) we build netbsd.gdb *and*
  netbsd-${KERNEL_CONFIG}.debug because it is not worth having two sets of
  rules (one that builds just netbsd.gdb and one that builds both netbsd.gdb
  and netbsd-${KERNEL_CONFIG}.debug. This maintains compatibility building
  netbsd.gdb when DEBUG=-g
- When either MKDEBUGKERNEL=yes or MKDEBUG=tes we set DEBUG=-g if DEBUG was
  not set.
- We only make a debuginstall rule to install netbsd-${KERNEL_CONFIG}.debug
  if MKDEBUG=yes


To generate a diff of this commit:
cvs rdiff -u -r1.290 -r1.291 src/sys/conf/Makefile.kern.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.290 src/sys/conf/Makefile.kern.inc:1.291
--- src/sys/conf/Makefile.kern.inc:1.290	Thu Dec 30 12:25:40 2021
+++ src/sys/conf/Makefile.kern.inc	Thu Dec 30 13:53:35 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.290 2021/12/30 17:25:40 christos Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.291 2021/12/30 18:53:35 christos Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -20,6 +20,8 @@
 # Default DEBUG to -g if kernel debug info is requested by MKDEBUGKERNEL=yes
 .if ${MKDEBUGKERNEL:Uno} == "yes" || ${MKDEBUG:Uno} == "yes"
 DEBUG?=-g
+.else
+DEBUG?=
 .endif
 
 ##
@@ -255,9 +257,17 @@ SYSTEM_LD_TAIL_DEBUG?=&& set -x &&\
 LINKFLAGS_NORMAL?=	-S
 STRIPFLAGS?=	-g
 
-DEBUG?=
 .if !empty(DEBUG:M-g*)
+SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_DEBUG}
+LINKFLAGS+=	${LINKFLAGS_DEBUG}
+EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gdb@}
+CTFFLAGS+=	-g
+TARGETSFX=	.gdb
+.elifndef PROF
+LINKFLAGS+=	${LINKFLAGS_NORMAL}
+.endif
 
+.if ${MKDEBUG:Uno} == "yes"
 # XXX: KERNEL_DIR?
 debuginstall: install-kernel-debug
 .for k in ${KERNELS}
@@ -267,17 +277,7 @@ ${DESTDIR}${DEBUGDIR}/${k}-${KERNEL_CONF
 	${_MKTARGET_INSTALL}
 	${INSTALL_FILE} -o root -g bin -m 444 ${.ALLSRC} ${.TARGET}
 .endfor
-
-SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_DEBUG}
-LINKFLAGS+=	${LINKFLAGS_DEBUG}
-EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gdb@}
-CTFFLAGS+=	-g
-TARGETSFX=	.gdb
-.elifndef PROF
-LINKFLAGS+=	${LINKFLAGS_NORMAL}
-.endif
-
-.if !target(debuginstall)
+.else
 debuginstall:
 .endif
 

Reply via email to