Remove indirection of _sub target for using _SUBDIR.

This reverts r266473 as the need for it, working around .MAKE and '+'
issues, is no longer needed after r289460.  This avoids extra log
output in -j builds of '-- _sub.TARGET --' that are redundant with the
'-- TARGET --' and '-- TARGET_subdir_DIR --' entries already showing.

r266473 also made a subtle change in the ordering of _SUBDIR handling.  Before
the change, SUBDIRS were recursed into after building the TARGET due to the
.USE of _SUBDIR *appending* the commands onto the TARGET.  After the change
though the indirection caused TARGET to depend on _sub.TARGET which had the
_SUBDIR handling in it.  This TARGET would run after recursing.  However, the
SUBDIR_PARALLEL handling from r263778 has this ordering as well.  Since
this has so far not been a problem, for now make this behavior for
non-SUBDIR_PARALLEL use of _SUBDIR explicit by using .USEBEFORE.
Further research may change this back to .USE as well as the
SUBDIR_PARALLEL handling and bsd.progs.mk recursing.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
bdrewery 2015-10-21 16:24:44 +00:00
parent 12b6417dcc
commit 82833332a3

View File

@ -72,9 +72,9 @@ _SUBDIR_SH= \
cd ${.CURDIR}/$${dir}; \
${MAKE} $${target} DIRPRFX=${DIRPRFX}$${dir}/
_SUBDIR: .USE .MAKE
_SUBDIR: .USEBEFORE
.if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR)
@${_+_}target=${.TARGET:S,realinstall,install,:S,^_sub.,,}; \
@${_+_}target=${.TARGET:S,realinstall,install,}; \
for dir in ${SUBDIR:N.WAIT}; do ${_SUBDIR_SH}; done
.endif
@ -107,8 +107,7 @@ ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps}
.endfor
${__target}: ${__subdir_targets}
.else
${__target}: _sub.${__target}
_sub.${__target}: _SUBDIR
${__target}: _SUBDIR
.endif
.endfor
@ -119,8 +118,7 @@ _sub.${__target}: _SUBDIR
.for __stage in build install
${__stage}${__target}:
.if make(${__stage}${__target})
${__stage}${__target}: _sub.${__stage}${__target}
_sub.${__stage}${__target}: _SUBDIR
${__stage}${__target}: _SUBDIR
.endif
.endfor
.if !target(${__target})