bsd.confs.mk: Support CONFGROUPS.yes

Align CONFGROUPS with other options like SUBDIRS and FILESGROUPS by
supporting the CONFGROUPS.yes option.  This means logic like this:

.if ${MK_FOO} != "no"
CONFGROUPS+= FOO
.endif

can be replaced by:

CONFGROUPS.${MK_FOO}+= FOO

MFC after:	1 week
Reviewed by:	imp
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D52923
This commit is contained in:
Lexi Winter
2025-10-08 07:07:10 +01:00
parent fa6d67cd16
commit 0f5ed3c427
+8
View File
@@ -22,6 +22,14 @@ buildconfig: ${${group}}
all: buildconfig
. endif
# Take groups from both CONFGROUPS and CONFGROUPS.yes, to allow syntax like
# CONFGROUPS.${MK_FOO}=FOO. Sort and uniq the list of groups in case of
# duplicates.
.if defined(CONFGROUPS) || defined(CONFGROUPS.yes)
CONFGROUPS:=${CONFGROUPS} ${CONFGROUPS.yes}
CONFGROUPS:=${CONFGROUPS:O:u}
.endif
. for group in ${CONFGROUPS}
. if defined(${group}) && !empty(${group})