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