Simplify and collapse a lot of the gooey .l and .y handling cruft here.

Rather than special-case a bunch of stuff, make this always parallel-safe,
and have make call upon the .l.c/.y.c followed by .c.o/.c.lo transforms,
rather than try to go right from .l/.y to .o/.lo.
This commit is contained in:
tv 2001-10-19 16:15:40 +00:00
parent cd08ea4664
commit 4a7f86b870
1 changed files with 10 additions and 47 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.sys.mk,v 1.51 2001/10/09 05:19:04 enami Exp $
# $NetBSD: bsd.sys.mk,v 1.52 2001/10/19 16:15:40 tv Exp $
#
# Overrides used for NetBSD source tree builds.
@ -77,63 +77,26 @@ MTREE?= mtree
.c.lo:
${HOST_COMPILE.c} -o ${.TARGET} ${.IMPSRC}
.if defined(PARALLEL) || defined(LPREFIX)
LPREFIX?=yy
LFLAGS+=-P${LPREFIX}
# Lex
LPREFIX?= yy
LFLAGS+= -P${LPREFIX}
.l.o: # remove to force use of .l.c->.c.o transforms
.l:
${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
${LINK.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c ${LDLIBS} -ll
rm -f ${.TARGET:R}.${LPREFIX}.c
.l.c:
${LEX.l} -o${.TARGET} ${.IMPSRC}
.l.o:
${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c
rm -f ${.TARGET:R}.${LPREFIX}.c
.l.lo:
${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c
rm -f ${.TARGET:R}.${LPREFIX}.c
.endif
# Yacc
.if defined(YHEADER) || defined(YPREFIX)
.if defined(YPREFIX)
YFLAGS+=-p${YPREFIX}
.endif
.if defined(YHEADER)
YFLAGS+=-d
.endif
YFLAGS+= ${YPREFIX:D-p${YPREFIX}} ${YHEADER:D-d}
.y.o: # remove to force use of .y.c->.c.o transforms
.y:
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
rm -f ${.TARGET:R}.tab.c ${.TARGET:R}.tab.h
.y.h: ${.TARGET:R}.c
rm -f ${.TARGET:R}.tab.[ch]
.y.h: ${.TARGET:.h=.c}
.y.c:
${YACC.y} -o ${.TARGET} ${.IMPSRC}
.y.o:
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
rm -f ${.TARGET:R}.tab.c ${TARGET:R}.tab.h
.y.lo:
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
rm -f ${.TARGET:R}.tab.c ${TARGET:R}.tab.h
.elif defined(PARALLEL)
.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} -o ${.TARGET} ${.IMPSRC}
.y.o:
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
rm -f ${.TARGET:R}.tab.c
.y.lo:
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
rm -f ${.TARGET:R}.tab.c
.endif