- Replaced several := ops with their += equivalents; the old
form became unnecessary with the bsd.prog.mk,v 1.69 change. - Eliminated duplicate y.tab.h in SRCS. Reviewed by: bde - Complementary to the said bsd.prog.mk change, use the fact that inner .for loops are not real loops but a tricky form of a local macro for the outer loop's variable, and switch to using faster variable modifiers to replace extensions.
This commit is contained in:
parent
08fe4bfbda
commit
484933a925
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124435
@ -71,32 +71,31 @@ tags: ${SRCS}
|
||||
CLEANFILES?=
|
||||
|
||||
.for _LSRC in ${SRCS:M*.l:N*/*}
|
||||
.for _LC in ${_LSRC:S/.l/.c/}
|
||||
.for _LC in ${_LSRC:R}.c
|
||||
${_LC}: ${_LSRC}
|
||||
${LEX} -t ${LFLAGS} ${.ALLSRC} > ${.TARGET}
|
||||
SRCS:= ${SRCS:S/${_LSRC}/${_LC}/}
|
||||
CLEANFILES:= ${CLEANFILES} ${_LC}
|
||||
CLEANFILES+= ${_LC}
|
||||
.endfor
|
||||
.endfor
|
||||
|
||||
.for _YSRC in ${SRCS:M*.y:N*/*}
|
||||
.for _YC in ${_YSRC:S/.y/.c/}
|
||||
.for _YC in ${_YSRC:R}.c
|
||||
SRCS:= ${SRCS:S/${_YSRC}/${_YC}/}
|
||||
CLEANFILES:= ${CLEANFILES} ${_YC}
|
||||
CLEANFILES+= ${_YC}
|
||||
.if ${YFLAGS:M-d} != "" && ${SRCS:My.tab.h}
|
||||
.ORDER: ${_YC} y.tab.h
|
||||
${_YC} y.tab.h: ${_YSRC}
|
||||
${YACC} ${YFLAGS} ${.ALLSRC}
|
||||
cp y.tab.c ${_YC}
|
||||
SRCS:= ${SRCS} y.tab.h
|
||||
CLEANFILES:= ${CLEANFILES} y.tab.c y.tab.h
|
||||
CLEANFILES+= y.tab.c y.tab.h
|
||||
.elif ${YFLAGS:M-d} != ""
|
||||
.for _YH in ${_YC:S/.c/.h/}
|
||||
.for _YH in ${_YC:R}.h
|
||||
.ORDER: ${_YC} ${_YH}
|
||||
${_YC} ${_YH}: ${_YSRC}
|
||||
${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
|
||||
SRCS:= ${SRCS} ${_YH}
|
||||
CLEANFILES:= ${CLEANFILES} ${_YH}
|
||||
SRCS+= ${_YH}
|
||||
CLEANFILES+= ${_YH}
|
||||
.endfor
|
||||
.else
|
||||
${_YC}: ${_YSRC}
|
||||
|
Loading…
Reference in New Issue
Block a user