diff options
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/bsd.dep.mk | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index b98666e..12a51e0 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -1,4 +1,4 @@ -# $Id: bsd.dep.mk,v 1.20 1998/05/06 18:43:58 bde Exp $ +# $Id: bsd.dep.mk,v 1.21 1998/05/08 06:31:05 bde Exp $ # # The include file <bsd.dep.mk> handles Makefile dependencies. # @@ -31,6 +31,45 @@ MKDEPCMD?= mkdep DEPENDFILE?= .depend +.if defined(SRCS) +CLEANFILES?= + +.for _LSRC in ${SRCS:M*.l:N*/*} +.for _LC in ${_LSRC:S/.l/.c/} +${_LC}: ${_LSRC} + ${LEX} -t ${LFLAGS} ${.ALLSRC} > ${.TARGET} +SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} +CLEANFILES:= ${CLEANFILES} ${_LC} +.endfor +.endfor + +.for _YSRC in ${SRCS:M*.y:N*/*} +.for _YC in ${_YSRC:S/.y/.c/} +SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} +CLEANFILES:= ${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 +.elif ${YFLAGS:M-d} != "" +.for _YH in ${_YC:S/.c/.h/} +.ORDER: ${_YC} ${_YH} +${_YC} ${_YH}: ${_YSRC} + ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} +SRCS:= ${SRCS} ${_YH} +CLEANFILES:= ${CLEANFILES} ${_YH} +.endfor +.else +${_YC}: ${_YSRC} + ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} +.endif +.endfor +.endfor +.endif + .if !target(depend) .if defined(SRCS) depend: beforedepend ${DEPENDFILE} afterdepend _SUBDIR @@ -74,45 +113,6 @@ afterdepend: .endif .endif -.if defined(SRCS) -CLEANFILES?= - -.for _LSRC in ${SRCS:M*.l:N*/*} -.for _LC in ${_LSRC:S/.l/.c/} -${_LC}: ${_LSRC} - ${LEX} -t ${LFLAGS} ${.ALLSRC} > ${.TARGET} -SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} -CLEANFILES:= ${CLEANFILES} ${_LC} -.endfor -.endfor - -.for _YSRC in ${SRCS:M*.y:N*/*} -.for _YC in ${_YSRC:S/.y/.c/} -SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} -CLEANFILES:= ${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 -.elif ${YFLAGS:M-d} != "" -.for _YH in ${_YC:S/.c/.h/} -.ORDER: ${_YC} ${_YH} -${_YC} ${_YH}: ${_YSRC} - ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} -SRCS:= ${SRCS} ${_YH} -CLEANFILES:= ${CLEANFILES} ${_YH} -.endfor -.else -${_YC}: ${_YSRC} - ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} -.endif -.endfor -.endfor -.endif - .if defined(NOTAGS) tags: .endif |