Reduce the number of knobs controlling the build of debug modules

to one, DEBUG_FLAGS, which is also compatible with <bsd.prog.mk>.
Previously one had to set both DEBUG and DEBUG_FLAGS to build the
.ko.debug with debugging symbols which was boring when doing this
manually.
This commit is contained in:
Ruslan Ermilov 2004-02-13 10:40:54 +00:00
parent 9673a2c2d0
commit 817b59bff6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125772
2 changed files with 7 additions and 8 deletions

View file

@ -98,5 +98,5 @@ MKMODULESENV+= ALL_MODULES=LINT
MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}"
.endif
.if defined(DEBUG)
MKMODULESENV+= DEBUG="${DEBUG}" DEBUG_FLAGS="${DEBUG}"
MKMODULESENV+= DEBUG_FLAGS="${DEBUG}"
.endif

View file

@ -117,7 +117,7 @@ OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
PROG= ${KMOD}.ko
.endif
.if !defined(DEBUG)
.if !defined(DEBUG_FLAGS)
FULLPROG= ${PROG}
.else
FULLPROG= ${PROG}.debug
@ -127,8 +127,8 @@ ${PROG}: ${FULLPROG}
${FULLPROG}: ${KMOD}.kld
${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld
.if !defined(DEBUG)
${OBJCOPY} --strip-debug ${FULLPROG}
.if !defined(DEBUG_FLAGS)
${OBJCOPY} --strip-debug ${.TARGET}
.endif
EXPORT_SYMS?= NO
@ -191,7 +191,7 @@ ${_ILINKS}:
CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS} ${_ILINKS} symb.tmp tmp.o
.if defined(DEBUG)
.if defined(DEBUG_FLAGS)
CLEANFILES+= ${FULLPROG}
.endif
@ -202,7 +202,7 @@ _INSTALLFLAGS:= ${INSTALLFLAGS}
_INSTALLFLAGS:= ${_INSTALLFLAGS${ie}}
.endfor
.if defined(DEBUG)
.if defined(DEBUG_FLAGS)
install.debug:
cd ${.CURDIR}; ${MAKE} -DINSTALL_DEBUG install
.endif
@ -210,12 +210,11 @@ install.debug:
.if !target(realinstall)
realinstall: _kmodinstall
.ORDER: beforeinstall _kmodinstall
.if defined(DEBUG) && defined(INSTALL_DEBUG)
_kmodinstall:
.if defined(DEBUG_FLAGS) && defined(INSTALL_DEBUG)
${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
${_INSTALLFLAGS} ${FULLPROG} ${DESTDIR}${KMODDIR}
.else
_kmodinstall:
${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}