Subject: make rule changes
To: None <tech-userlevel@NetBSD.ORG>
From: Christos Zoulas <christos@deshaw.com>
List: tech-userlevel
Date: 10/19/1995 22:51:28
I was thinking of changing the lex and yacc rules in sys.mk, so that
they work properly with parallel make. The lex changes are trivial and
don't affect anything, but the yacc changes affect programs that need
y.tab.h [i.e. they include y.tab.h, and this will rename the output to
foo.tab.h]. I don't know how to do this in a less intrusive way... 
Any ideas?

christos

# 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

# Yacc
.y:
        ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
        ${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
        rm -f ${.TARGET:R}.tab.c
.y.c:
        ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
        mv ${.TARGET:R}.tab.c ${.TARGET}
.y.o:
        ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
        ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
        rm -f ${.TARGET:R}.tab.c