On Wed, Jul 05, 2017 at 06:49:30AM -0600, Todd C. Miller wrote: > I wonder if it would be better to use lex.${.PREFIX}.c instead of > ${.PREFIX}.lex.c. This would be more consistent with how lex's > -Pprefix flag behaves. > > It's not a big deal either way as the file is strictly temporary. > > - todd
Sure thing. Index: bsd.sys.mk =================================================================== RCS file: /cvs/src/share/mk/bsd.sys.mk,v retrieving revision 1.11 diff -u -p -r1.11 bsd.sys.mk --- bsd.sys.mk 1 Jul 2017 14:41:54 -0000 1.11 +++ bsd.sys.mk 5 Jul 2017 12:53:46 -0000 @@ -11,19 +11,6 @@ CXXFLAGS+= -idirafter ${DESTDIR}/usr/inc .endif .if defined(PARALLEL) -# Lex -.l: - ${LEX.l} -o${.TARGET:R}.yy.c ${.IMPSRC} - ${LINK.c} -o ${.TARGET} ${.TARGET:R}.yy.c ${LDLIBS} -ll - rm -f ${.TARGET:R}.yy.c -.l.c: - ${LEX.l} -o${.TARGET} ${.IMPSRC} -.l.o: - ${LEX.l} -o${.TARGET:R}.yy.c ${.IMPSRC} - ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.yy.c - rm -f ${.TARGET:R}.yy.c - if test -f ${.TARGET:R}.d; then sed -i -e 's,${.TARGET:R}.yy.c,${.IMPSRC},' ${.TARGET:R}.d; fi - # Yacc .y: ${YACC.y} -b ${.TARGET:R} ${.IMPSRC} Index: sys.mk =================================================================== RCS file: /cvs/src/share/mk/sys.mk,v retrieving revision 1.78 diff -u -p -r1.78 sys.mk --- sys.mk 1 Jul 2017 14:41:54 -0000 1.78 +++ sys.mk 5 Jul 2017 12:53:46 -0000 @@ -185,17 +185,16 @@ CTAGS?= /usr/bin/ctags # Lex .l: - ${LEX.l} ${.IMPSRC} - ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll - rm -f lex.yy.c + ${LEX.l} -o lex.${.PREFIX}.c ${.IMPSRC} + ${LINK.c} -o ${.TARGET} lex.${.PREFIX}.c ${LDLIBS} -ll + rm -f lex.${.PREFIX}.c .l.c: - ${LEX.l} ${.IMPSRC} - mv lex.yy.c ${.TARGET} + ${LEX.l} -o ${.TARGET} ${.IMPSRC} .l.o: - ${LEX.l} ${.IMPSRC} - ${COMPILE.c} -o ${.TARGET} lex.yy.c - rm -f lex.yy.c - if test -f ${.TARGET:R}.d; then sed -i -e 's,lex.yy.c,${.IMPSRC},' ${.TARGET:R}.d; fi + ${LEX.l} -o lex.${.PREFIX}.c ${.IMPSRC} + ${COMPILE.c} -c lex.${.PREFIX}.c + rm -f lex.${.PREFIX}.c + if test -f ${.TARGET:R}.d; then sed -i -e 's,lex.${.PREFIX}.lex.c,${.IMPSRC},' ${.TARGET:R}.d; fi # Yacc .y: apart from that, okay ?