diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-05-27 23:01:22 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-05-27 23:01:22 +0000 |
commit | eb1ca9bf83835afa564afb5fe71fde464a770b69 (patch) | |
tree | c59ab5691817dff96d56ca2e3037d210034f62b7 | |
parent | 83acb5e2c36b12eeb78bfff67d27df8062157dac (diff) |
support 'make lint' in dirs which contain .y and .l files, help from naddy
-rw-r--r-- | share/mk/bsd.prog.mk | 6 | ||||
-rw-r--r-- | share/mk/bsd.sys.mk | 12 | ||||
-rw-r--r-- | share/mk/sys.mk | 12 |
3 files changed, 25 insertions, 5 deletions
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 751c452ebdd..f12afd74d7f 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.prog.mk,v 1.46 2005/09/16 21:23:21 espie Exp $ +# $OpenBSD: bsd.prog.mk,v 1.47 2006/05/27 23:01:21 deraadt Exp $ # $NetBSD: bsd.prog.mk,v 1.55 1996/04/08 21:19:26 jtc Exp $ # @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 @@ -8,7 +8,7 @@ .include <bsd.own.mk> -.SUFFIXES: .out .o .c .cc .C .cxx .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 +.SUFFIXES: .out .ln .o .c .cc .C .cxx .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 .if ${WARNINGS:L} == "yes" CFLAGS+= ${CDIAGFLAGS} @@ -81,7 +81,7 @@ LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a SRCS?= ${PROG}.c . if !empty(SRCS:N*.h:N*.sh) OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g} -LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} +LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} ${SRCS:M*.y:.y=.ln} ${SRCS:M*.l:.l=.ln} . endif . if defined(OBJS) && !empty(OBJS) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 769b326a16d..1e6bc19cf55 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.sys.mk,v 1.8 2000/07/06 23:12:41 millert Exp $ +# $OpenBSD: bsd.sys.mk,v 1.9 2006/05/27 23:01:21 deraadt Exp $ # $NetBSD: bsd.sys.mk,v 1.2 1995/12/13 01:25:07 cgd Exp $ # # Overrides used for OpenBSD source tree builds. @@ -22,6 +22,11 @@ CXXFLAGS+= -idirafter ${DESTDIR}/usr/include/g++ ${LEX.l} -o${.TARGET:R}.yy.c ${.IMPSRC} ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.yy.c rm -f ${.TARGET:R}.yy.c +.l.ln: + ${LEX.l} ${.IMPSRC} + mv lex.yy.c ${.TARGET:R}.c + ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} -i ${.TARGET:R}.c + rm -f ${.TARGET:R}.c # Yacc .y: @@ -35,4 +40,9 @@ CXXFLAGS+= -idirafter ${DESTDIR}/usr/include/g++ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC} ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c rm -f ${.TARGET:R}.tab.c +.y.ln: + ${YACC.y} ${.IMPSRC} + mv y.tab.c ${.TARGET:R}.c + ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${.TARGET:R}.c + rm -f ${.TARGET:R}.c .endif diff --git a/share/mk/sys.mk b/share/mk/sys.mk index fcea85390b6..dee35827dac 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -1,4 +1,4 @@ -# $OpenBSD: sys.mk,v 1.48 2006/04/01 05:53:39 deraadt Exp $ +# $OpenBSD: sys.mk,v 1.49 2006/05/27 23:01:21 deraadt Exp $ # $NetBSD: sys.mk,v 1.27 1996/04/10 05:47:19 mycroft Exp $ # @(#)sys.mk 5.11 (Berkeley) 3/13/91 @@ -193,6 +193,11 @@ CTAGS?= /usr/bin/ctags ${LEX.l} ${.IMPSRC} ${COMPILE.c} -o ${.TARGET} lex.yy.c rm -f lex.yy.c +.l.ln: + ${LEX.l} ${.IMPSRC} + mv lex.yy.c ${.TARGET:R}.c + ${LINT} ${LINTFLAGS} ${CFLAGS:M-[IDU]*} ${CPPFLAGS:M-[IDU]*} -i ${.TARGET:R}.c + rm -f ${.TARGET:R}.c # Yacc .y: @@ -206,6 +211,11 @@ CTAGS?= /usr/bin/ctags ${YACC.y} ${.IMPSRC} ${COMPILE.c} -o ${.TARGET} y.tab.c rm -f y.tab.c +.y.ln: + ${YACC.y} ${.IMPSRC} + mv y.tab.c ${.TARGET:R}.c + ${LINT} ${LINTFLAGS} ${CFLAGS:M-[IDU]*} ${CPPFLAGS:M-[IDU]*} -i ${.TARGET:R}.c + rm -f ${.TARGET:R}.c # Shell .sh: |