Home | History | Annotate | Line # | Download | only in conf
lint.mk revision 1.2
      1  1.2    rillig # $NetBSD: lint.mk,v 1.2 2021/05/02 19:29:30 rillig Exp $
      2  1.1  uebayasi 
      3  1.1  uebayasi ##
      4  1.1  uebayasi ## lint
      5  1.1  uebayasi ##
      6  1.1  uebayasi 
      7  1.1  uebayasi .if !target(lint)
      8  1.2    rillig .PATH: $S
      9  1.1  uebayasi ALLSFILES?=	${MD_SFILES} ${SFILES}
     10  1.1  uebayasi LINTSTUBS?=	${ALLSFILES:T:R:C/^.*$/LintStub_&.c/g}
     11  1.1  uebayasi KERNLINTFLAGS?=	-bcehnxzFS
     12  1.1  uebayasi NORMAL_LN?=	${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i $< -o $@
     13  1.1  uebayasi 
     14  1.1  uebayasi _lsrc=${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
     15  1.1  uebayasi LOBJS?= ${_lsrc:T:S/.c$/.ln/g} ${LIBKERNLN} ${SYSLIBCOMPATLN}
     16  1.1  uebayasi 
     17  1.1  uebayasi .for _sfile in ${ALLSFILES}
     18  1.1  uebayasi LintStub_${_sfile:T:R}.c: ${_sfile} assym.h
     19  1.1  uebayasi 	${_MKTARGET_COMPILE}
     20  1.1  uebayasi 	${CC} -E -C ${AFLAGS} ${CPPFLAGS} ${_sfile} | \
     21  1.1  uebayasi 	      ${TOOL_AWK} -f $S/kern/genlintstub.awk >${.TARGET}
     22  1.1  uebayasi .endfor
     23  1.1  uebayasi 
     24  1.1  uebayasi .for _cfile in ${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
     25  1.1  uebayasi ${_cfile:T:R}.ln: ${_cfile}
     26  1.1  uebayasi 	${_MKTARGET_COMPILE}
     27  1.1  uebayasi 	${NORMAL_LN}
     28  1.1  uebayasi .endfor
     29  1.1  uebayasi 
     30  1.1  uebayasi lint: ${LOBJS}
     31  1.1  uebayasi 	${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} ${LOBJS}
     32  1.1  uebayasi .endif
     33  1.1  uebayasi 
     34  1.1  uebayasi # XXX who uses this?
     35  1.1  uebayasi # Attempt to do a syntax-only compile of the entire kernel as one entity.
     36  1.1  uebayasi # Alas, bugs in the GCC C frontend prevent this from completely effective
     37  1.1  uebayasi # but information can be gleaned from the output.
     38  1.1  uebayasi syntax-only: ${CFILES} ${MD_CFILES}
     39  1.1  uebayasi 	${CC} -fsyntax-only -combine ${CFLAGS} ${CPPFLAGS} \
     40  1.1  uebayasi 		${CFILES} ${MD_CFILES}
     41