diff options
author | markm <markm@FreeBSD.org> | 2002-03-17 10:05:57 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2002-03-17 10:05:57 +0000 |
commit | 006a375bc447bfc5b3db07294bf35dbe748b38a9 (patch) | |
tree | b5f6765714d9527fdbcc32ed40c937ff32a4e7f3 /share/mk | |
parent | 476738c7e694d584b48165f22f5def3cbad868b5 (diff) | |
download | FreeBSD-src-006a375bc447bfc5b3db07294bf35dbe748b38a9.zip FreeBSD-src-006a375bc447bfc5b3db07294bf35dbe748b38a9.tar.gz |
Allow "make lint" to mostly work. Our sources are very unclean WRT
lint, so this is turned off by default. Setting WANT_LINT will turn
on generation of lint libraries for /usr/libdata/lint/*.ln.
Reviewd by: silence in -audit.
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/bsd.lib.mk | 41 | ||||
-rw-r--r-- | share/mk/sys.mk | 5 |
2 files changed, 38 insertions, 8 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index a934339..9890208 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -54,7 +54,15 @@ STRIP?= -s # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries # .So used for PIC object files .SUFFIXES: -.SUFFIXES: .out .o .po .So .S .s .c .cc .cpp .cxx .m .C .f .y .l +.SUFFIXES: .out .o .po .So .S .s .c .cc .cpp .cxx .m .C .f .y .l .ln + +.c.ln: + ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} || \ + touch ${.TARGET} + +.cc.ln .C.ln .cpp.ln .cxx.ln: + ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} || \ + touch ${.TARGET} .c.o: ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} @@ -157,6 +165,14 @@ _LIBS=lib${LIB}.a .endif .endif +LINTOBJS+= ${SRCS:M*.c:C/\..+$/.ln/} + +.if defined(WANT_LINT) && defined(LIB) && defined(LINTOBJS) && (${LINTOBJS} != "") +LINTLIB=llib-l${LIB}.ln +.else +LINTLIB= +.endif + .if defined(SHLIB_NAME) _LIBS+=${SHLIB_NAME} .endif @@ -173,9 +189,9 @@ PICFLAG=-fpic .endif .if !defined(NOMAN) -all: objwarn ${_LIBS} all-man _SUBDIR # llib-l${LIB}.ln +all: objwarn ${_LIBS} all-man _SUBDIR ${LINTLIB} .else -all: objwarn ${_LIBS} _SUBDIR # llib-l${LIB}.ln +all: objwarn ${_LIBS} _SUBDIR ${LINTLIB} .endif OBJS+= ${SRCS:N*.h:R:S/$/.o/g} @@ -223,17 +239,22 @@ lib${LIB}_pic.a:: ${SOBJS} ${RANLIB} lib${LIB}_pic.a .endif -llib-l${LIB}.ln: ${SRCS} - ${LINT} -C${LIB} ${CFLAGS:M-[DIU]*} ${.ALLSRC:M*.c} +.if defined(WANT_LINT) && defined(LIB) && defined(LINTOBJS) && (${LINTOBJS} != "") +${LINTLIB}: ${LINTOBJS} + @${ECHO} building lint library ${SHLIB_NAME} + @rm -f ${LINTLIB} + ${LINT} ${LINTLIBFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} +.endif .if !target(clean) clean: _SUBDIR rm -f a.out ${OBJS} ${STATICOBJS} ${OBJS:S/$/.tmp/} ${CLEANFILES} - rm -f lib${LIB}.a # llib-l${LIB}.ln + rm -f lib${LIB}.a ${LINTLIB} rm -f ${POBJS} ${POBJS:S/$/.tmp/} lib${LIB}_p.a rm -f ${SOBJS} ${SOBJS:.So=.so} ${SOBJS:S/$/.tmp/} \ ${SHLIB_NAME} ${SHLIB_LINK} \ lib${LIB}.so.* lib${LIB}.so lib${LIB}_pic.a + rm -f ${LINTOBJS} ${LINTLIB} .if defined(CLEANDIRS) && !empty(CLEANDIRS) rm -rf ${CLEANDIRS} .endif @@ -327,6 +348,10 @@ realinstall: beforeinstall ln -fs $$l $$t; \ done; true .endif +.if defined(WANT_LINT) && defined(LIB) && defined(LINTOBJS) && (${LINTOBJS} != "") + ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${_INSTALLFLAGS} ${LINTLIB} ${DESTDIR}${LINTLIBDIR} +.endif install: afterinstall _SUBDIR .if !defined(NOMAN) @@ -349,9 +374,11 @@ distribute: _SUBDIR .endif .if !target(lint) -lint: +lint: ${SRCS:M*.c} _SUBDIR + ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} | more 2>&1 .endif + .if !defined(NOMAN) .include <bsd.man.mk> .else diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 0011dc9..c0f72bd 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -76,7 +76,10 @@ LD ?= ld LDFLAGS ?= LINT ?= lint -LINTFLAGS ?= -chapbx +LINTFLAGS ?= -cghapbx -L /usr/libdata/lint +LINTKERNFLAGS ?= ${LINTFLAGS} +LINTOBJFLAGS ?= -cghapbxu -i +LINTLIBFLAGS ?= -cghapbxu -C ${LIB} MAKE ?= make |