A few changes to decrease parsing time and memory usage.

This commit is contained in:
mycroft 2000-06-06 05:33:58 +00:00
parent b756e7384d
commit d1460458fc

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.subdir.mk,v 1.34 2000/04/16 08:37:27 mrg Exp $
# $NetBSD: bsd.subdir.mk,v 1.35 2000/06/06 05:33:58 mycroft Exp $
# @(#)bsd.subdir.mk 8.1 (Berkeley) 6/8/93
.if !target(__initialized__)
@ -24,23 +24,25 @@ _M=-m ${DESTDIR}/usr/share/mk
_M=
.endif
.for dir in ${__REALSUBDIR}
.for targ in ${TARGETS}
.PHONY: ${targ}-${dir}
${targ}-${dir}: .MAKE
@case "${dir}" in /*) \
echo "${targ} ===> ${dir}"; \
cd ${dir}; \
${MAKE} ${_M} "_THISDIR_=${dir}/" ${targ}; \
;; \
*) \
echo "${targ} ===> ${_THISDIR_}${dir}"; \
cd ${.CURDIR}/${dir}; \
${MAKE} ${_M} "_THISDIR_=${_THISDIR_}${dir}/" ${targ}; \
;; \
__recurse: .USE
@targ=${.TARGET:C/-.*//};dir=${.TARGET:C/.*-//}; \
case "$$dir" in /*) \
echo "$$targ ===> $$dir"; \
cd "$$dir"; \
${MAKE} ${_M} "_THISDIR_=$$dir/" $$targ; \
;; \
*) \
echo "$$targ ===> ${_THISDIR_}$$dir"; \
cd "${.CURDIR}/$$dir"; \
${MAKE} ${_M} "_THISDIR_=${_THISDIR_}$$dir/" $$targ; \
;; \
esac
subdir-${targ}: ${targ}-${dir}
${targ}: subdir-${targ}
.for targ in ${TARGETS}
.for dir in ${__REALSUBDIR}
.PHONY: ${targ}-${dir}
${targ}-${dir}: .MAKE __recurse
${targ}: ${targ}-${dir}
.endfor
.endfor