aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLexi Winter <ivy@FreeBSD.org>2025-10-17 10:40:39 +0000
committerLexi Winter <ivy@FreeBSD.org>2025-10-17 10:42:51 +0000
commite757a92282fcd064c82cf2685dde4730743fc425 (patch)
treea225e8b0def4614333832656a2823cef070bc2a3
parentc26d6bf9da013e839d9a696746ea1741569e619e (diff)
bsd.man.mk: Support MANGROUPS.yes
Similar to SUBDIR and CONFGROUPS, this allows the use of MANGROUPS.${MK_FOO}, simplifying Makefile logic for optional manpages. MFC after: 3 seconds Reviewed by: emaste Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D53126
-rw-r--r--share/mk/bsd.man.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk
index 0a3594e05d94..1591a3e0905e 100644
--- a/share/mk/bsd.man.mk
+++ b/share/mk/bsd.man.mk
@@ -97,6 +97,14 @@ manlinksinstall: .PHONY
all-man:
+# Take groups from both MANGROUPS and MANGROUPS.yes, to allow syntax like
+# MANGROUPS.${MK_FOO}=FOO. Sort and uniq the list of groups in case of
+# duplicates.
+.if defined(MANGROUPS) || defined(MANGROUPS.yes)
+MANGROUPS:=${MANGROUPS} ${MANGROUPS.yes}
+MANGROUPS:=${MANGROUPS:O:u}
+.endif
+
.for __group in ${MANGROUPS}
realmaninstall: realmaninstall-${__group}