bsd.subdir.mk: Allow easier modification of [STANDALONE_]SUBDIR_TARGETS.

This reworks r289254 and removes ALL_SUBDIR_TARGETS.

Because there is an include guard in this file there is no need for
LOCAL_ or ?= on SUBDIR_TARGETS or STANDALONE_SUBDIR_TARGETS.  These can
just be set via src.conf.  By the time bsd.subdir.mk is included it will
just append the values to the existing value and work fine.  This allows
a consistent way to append to these variables without introducing a
LOCAL_ var for STANDALONE_SUBDIR_TARGETS or renaming the historical
SUBDIR_TARGETS.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Bryan Drewery 2016-01-19 22:42:07 +00:00
parent ddc3c00d4b
commit b69c69e000

View File

@ -25,27 +25,30 @@
# This is a variant of install, which will
# put the stuff into the right "distribution".
#
# See ALL_SUBDIR_TARGETS for list of targets that will recurse.
# Custom targets can be added to SUBDIR_TARGETS in src.conf.
# See SUBDIR_TARGETS for list of targets that will recurse.
#
# Targets defined in STANDALONE_SUBDIR_TARGETS will always be ran
# with SUBDIR_PARALLEL and will not respect .WAIT or SUBDIR_DEPEND_
# values.
#
# SUBDIR_TARGETS and STANDALONE_SUBDIR_TARGETS can be appended to
# via make.conf or src.conf.
#
.if !target(__<bsd.subdir.mk>__)
__<bsd.subdir.mk>__:
ALL_SUBDIR_TARGETS= all all-man buildconfig buildfiles buildincludes \
checkdpadd clean cleandepend cleandir cleanilinks \
cleanobj depend distribute files includes installconfig \
installfiles installincludes realinstall lint maninstall \
manlint obj objlink regress tags \
${SUBDIR_TARGETS}
SUBDIR_TARGETS+= \
all all-man buildconfig buildfiles buildincludes \
checkdpadd clean cleandepend cleandir cleanilinks \
cleanobj depend distribute files includes installconfig \
installfiles installincludes realinstall lint maninstall \
manlint obj objlink regress tags \
# Described above.
STANDALONE_SUBDIR_TARGETS?= obj checkdpadd clean cleandepend cleandir \
cleanilinks cleanobj installconfig
STANDALONE_SUBDIR_TARGETS+= \
obj checkdpadd clean cleandepend cleandir \
cleanilinks cleanobj installconfig \
.include <bsd.init.mk>
@ -115,7 +118,7 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE
dir=${.TARGET}; \
${_SUBDIR_SH};
.for __target in ${ALL_SUBDIR_TARGETS}
.for __target in ${SUBDIR_TARGETS}
# Only recurse on directly-called targets. I.e., don't recurse on dependencies
# such as 'install' becoming {before,real,after}install, just recurse
# 'install'. Despite that, 'realinstall' is special due to ordering issues
@ -154,12 +157,12 @@ ${__target}: ${__subdir_targets}
${__target}: _SUBDIR
.endif # SUBDIR_PARALLEL || _is_standalone_target
.endif # make(${__target})
.endfor # __target in ${ALL_SUBDIR_TARGETS}
.endfor # __target in ${SUBDIR_TARGETS}
.endif # !target(_SUBDIR)
# Ensure all targets exist
.for __target in ${ALL_SUBDIR_TARGETS}
.for __target in ${SUBDIR_TARGETS}
.if !target(${__target})
${__target}:
.endif