lint infrastructure overhaul to finally lint the kernel libs right.
XXX the dependencies for the kernel .ln files are just plain wrong. We need some sort of extended make depend hack to do it right. We will suffer with it for now.
This commit is contained in:
parent
9fcaba1f66
commit
7152bf6aeb
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile.kern.inc,v 1.26 2002/10/24 20:52:38 christos Exp $
|
||||
# $NetBSD: Makefile.kern.inc,v 1.27 2002/11/02 07:57:05 perry Exp $
|
||||
#
|
||||
# This file contains common `MI' targets and definitions and it is included
|
||||
# at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. There are
|
||||
|
@ -90,6 +90,8 @@ LIBKERN?= ${KERNLIB}
|
|||
LIBKERN?= ${KERNLIB_PROF}
|
||||
.endif
|
||||
|
||||
LIBKERNLN?= ${KERNLIBLN}
|
||||
|
||||
### find out what to use for libcompat
|
||||
.include "$S/compat/common/Makefile.inc"
|
||||
.ifndef PROF
|
||||
|
@ -98,6 +100,8 @@ LIBCOMPAT?= ${COMPATLIB}
|
|||
LIBCOMPAT?= ${COMPATLIB_PROF}
|
||||
.endif
|
||||
|
||||
LIBCOMPATLN?= ${COMPATLIBLN}
|
||||
|
||||
##
|
||||
## (4) local objects, compile rules, and dependencies
|
||||
##
|
||||
|
@ -205,7 +209,7 @@ assym.h machdep.o: Makefile
|
|||
.if !target(__CLEANKERNEL)
|
||||
__CLEANKERNEL: .USE
|
||||
@echo "${.TARGET}ing the kernel objects"
|
||||
rm -f ${KERNELS} eddep tags *.[io] [a-z]*.s vers.c \
|
||||
rm -f ${KERNELS} eddep tags *.[io] *.ln [a-z]*.s vers.c \
|
||||
[Ee]rrs linterrs makelinks assym.h.tmp assym.h \
|
||||
${EXTRA_KERNELS} ${EXTRA_CLEAN}
|
||||
.endif
|
||||
|
@ -246,18 +250,25 @@ dependall: depend all
|
|||
.if !target(lint)
|
||||
ALLSFILES?= ${MD_SFILES} ${SFILES}
|
||||
LINTSTUBS?= ${ALLSFILES:T:R:C/^.*$/LintStub_&.c/g}
|
||||
KERNLINTFLAGS?= -hbxncez -Dvolatile=
|
||||
KERNLINTFLAGS?= -bcehnxzFS
|
||||
NORMAL_LN?= ${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i $<
|
||||
|
||||
_lsrc=${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
|
||||
LOBJS?= ${_lsrc:T:S/.c$/.ln/g} ${LIBKERNLN} ${LIBCOMPATLN}
|
||||
|
||||
.for _sfile in ${ALLSFILES}
|
||||
LintStub_${_sfile:T:R}.c: ${_sfile} assym.h
|
||||
${CC} -E -C ${AFLAGS} ${CPPFLAGS} ${_sfile} | \
|
||||
awk -f $S/kern/genlintstub.awk >${.TARGET}
|
||||
.endfor
|
||||
lint: ${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
|
||||
# Ignore static function unused warnings [236]
|
||||
@echo ${LINT} ${KERNLINTFLAGS} ${CPPFLAGS} -UKGDB -X 236 \
|
||||
'$${CFILES} $${LINTSTUBS} $${MI_CFILES} $${MD_CFILES}'
|
||||
@${LINT} ${KERNLINTFLAGS} ${CPPFLAGS} -UKGDB \
|
||||
${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
|
||||
|
||||
.for _cfile in ${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
|
||||
${_cfile:T:R}.ln: ${_cfile}
|
||||
${NORMAL_LN}
|
||||
.endfor
|
||||
|
||||
lint: ${LOBJS}
|
||||
${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} ${LOBJS}
|
||||
.endif
|
||||
|
||||
.if !target(install)
|
||||
|
|
Loading…
Reference in New Issue