summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-09-20 19:32:51 +0000
committermarkm <markm@FreeBSD.org>2002-09-20 19:32:51 +0000
commit2fb7a39c0fdc17568c3b60cf37e5f3c2d6dff5e4 (patch)
tree083178cbf572757b603ee69a021bcca79a88f4ea /share
parent557fe83a6250afb6a265e7419a64f9784da04c78 (diff)
downloadFreeBSD-src-2fb7a39c0fdc17568c3b60cf37e5f3c2d6dff5e4.zip
FreeBSD-src-2fb7a39c0fdc17568c3b60cf37e5f3c2d6dff5e4.tar.gz
Extend the lint handling a bit.
o Make it possible to prevent parts of the tree from being linted (say) during a 'make world' by setting NOLINT in a leaf Makefile. o Make "make lint" work (better) for executable programs. o Clean up (nuke!) a syntax damaged pipeline.
Diffstat (limited to 'share')
-rw-r--r--share/mk/bsd.lib.mk6
-rw-r--r--share/mk/bsd.prog.mk6
-rw-r--r--share/mk/sys.mk8
3 files changed, 14 insertions, 6 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 1e70165..c3eabb3 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -204,7 +204,7 @@ lib${LIB}_pic.a: ${SOBJS}
${RANLIB} ${.TARGET}
.endif
-.if defined(WANT_LINT) && defined(LIB) && !empty(LIB)
+.if defined(WANT_LINT) && !defined(NOLINT) && defined(LIB) && !empty(LIB)
LINTLIB= llib-l${LIB}.ln
_LIBS+= ${LINTLIB}
LINTOBJS+= ${SRCS:M*.c:.c=.ln}
@@ -273,7 +273,7 @@ _libinstall:
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${LIBDIR}
.endif
-.if defined(WANT_LINT) && defined(LIB) && !empty(LIB)
+.if defined(WANT_LINT) && !defined(NOLINT) && defined(LIB) && !empty(LIB)
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} ${LINTLIB} ${DESTDIR}${LINTLIBDIR}
.endif
@@ -292,7 +292,7 @@ realinstall: _maninstall
.if !target(lint)
lint: ${SRCS:M*.c}
- ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC}
+ ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC}
.endif
.if !defined(NOMAN)
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index 15f9e37..ff1a708 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -3,7 +3,7 @@
.include <bsd.init.mk>
-.SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .s .S .asm
+.SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .ln .s .S .asm
CFLAGS+=${COPTS} ${DEBUG_FLAGS}
@@ -157,9 +157,9 @@ realinstall: _maninstall
.endif
.if !target(lint)
-lint: ${SRCS}
+lint: ${SRCS:M*.c}
.if defined(PROG)
- ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} | more 2>&1
+ ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC}
.endif
.endif
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index c24a34ef..ae84263 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -176,6 +176,14 @@ HTAGSFLAGS=
cp -p ${.IMPSRC} ${.TARGET}
chmod a+x ${.TARGET}
+.c.ln:
+ ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} || \
+ touch ${.TARGET}
+
+.cc.ln .C.ln .cpp.ln .cxx.ln:
+ ${LINT} ${LINTOBJFLAGS} ${CXXFLAGS:M-[DIU]*} ${.IMPSRC} || \
+ touch ${.TARGET}
+
.c:
${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
OpenPOWER on IntegriCloud