diff options
author | sjg <sjg@FreeBSD.org> | 2014-05-20 18:25:46 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2014-05-20 18:25:46 +0000 |
commit | 209ad51d448db5a8880d134bb8e7e55dcb59e8ed (patch) | |
tree | 9ed56ad7950dc9ef67686abb20edf61f86ac4037 /share | |
parent | 22a2a23b206a4acc2aeae883ca15ef3bc068207b (diff) | |
download | FreeBSD-src-209ad51d448db5a8880d134bb8e7e55dcb59e8ed.zip FreeBSD-src-209ad51d448db5a8880d134bb8e7e55dcb59e8ed.tar.gz |
Use an intermediate target to associate with _SUBDIR which is marked .MAKE
this allows make -n to do tree walks as expected without
doing anything else (as intended).
Use prefix _sub. to help avoid conflict with any real target.
Reviewed by: imp
Diffstat (limited to 'share')
-rw-r--r-- | share/mk/bsd.subdir.mk | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 1500947..b93a5d7 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -47,15 +47,15 @@ _SUBDIR: .USE .MAKE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) @${_+_}set -e; for entry in ${SUBDIR:N.WAIT}; do \ if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ - ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:realinstall=install})"; \ + ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \ edir=$${entry}.${MACHINE_ARCH}; \ cd ${.CURDIR}/$${edir}; \ else \ - ${ECHODIR} "===> ${DIRPRFX}$$entry (${.TARGET:realinstall=install})"; \ + ${ECHODIR} "===> ${DIRPRFX}$$entry (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \ edir=$${entry}; \ cd ${.CURDIR}/$${edir}; \ fi; \ - ${MAKE} ${.TARGET:realinstall=install} \ + ${MAKE} ${.TARGET:S,realinstall,install,:S,^_sub.,,} \ DIRPRFX=${DIRPRFX}$$edir/; \ done .endif @@ -97,7 +97,8 @@ ${__target}_subdir_${__dir}: .MAKE .endfor ${__target}: ${__subdir_targets} .else -${__target}: _SUBDIR +${__target}: _sub.${__target} +_sub.${__target}: _SUBDIR .endif .endfor @@ -105,11 +106,14 @@ ${__target}: _SUBDIR .for __stage in build install ${__stage}${__target}: .if make(${__stage}${__target}) -${__stage}${__target}: _SUBDIR +${__stage}${__target}: _sub.${__stage}${__target} +_sub.${__stage}${__target}: _SUBDIR .endif .endfor +.if !target(${__target}) ${__target}: .MAKE ${_+_}set -e; cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target} +.endif .endfor .if !target(install) |