git: 53a27d89551e - main - bsd.incs.mk: Add support to override tags for a specific include group
Emmanuel Vadot
manu at FreeBSD.org
Mon Jan 4 15:25:22 UTC 2021
The branch main has been updated by manu:
URL: https://cgit.FreeBSD.org/src/commit/?id=53a27d89551e2f10ec166ea3beec4a479642434f
commit 53a27d89551e2f10ec166ea3beec4a479642434f
Author: Emmanuel Vadot <manu at freebsd.org>
AuthorDate: 2020-12-14 17:53:34 +0000
Commit: Emmanuel Vadot <manu at FreeBSD.org>
CommitDate: 2021-01-04 15:21:32 +0000
bsd.incs.mk: Add support to override tags for a specific include group
With this patch if a Makefile is using the INCSGROUPS mechanisms it can
override the default package for specific includes files using
GROUPPACKAGE= mynewpackage
While here add a few comments after endif/endfor so it's easier to read.
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D27611
---
share/mk/bsd.incs.mk | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/share/mk/bsd.incs.mk b/share/mk/bsd.incs.mk
index 959f1b4748d1..1492c07ca6be 100644
--- a/share/mk/bsd.incs.mk
+++ b/share/mk/bsd.incs.mk
@@ -8,13 +8,6 @@
INCSGROUPS?= INCS
-.if defined(NO_ROOT)
-.if !defined(TAGS) || ! ${TAGS:Mpackage=*}
-TAGS+= package=${PACKAGE:Uutilities}
-.endif
-TAG_ARGS= -T ${TAGS:[*]:S/ /,/g}
-.endif
-
.if !target(buildincludes)
.for group in ${INCSGROUPS}
buildincludes: ${${group}}
@@ -37,6 +30,17 @@ STAGE_SETS+= ${group:C,[/*],_,g}
STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR}
STAGE_SYMLINKS_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}
+.if defined(NO_ROOT)
+.if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*}
+.if defined(${group}PACKAGE)
+${group}TAGS+= package=${${group}PACKAGE:Uutilities},dev
+.else
+${group}TAGS+= package=${PACKAGE:Uutilities},dev
+.endif
+.endif
+${group}TAG_ARGS= -T ${${group}TAGS:[*]:S/ /,/g}
+.endif
+
_${group}INCS=
.for header in ${${group}}
.if defined(${group}OWN_${header:T}) || defined(${group}GRP_${header:T}) || \
@@ -67,7 +71,7 @@ _${group}INS_${header:T}: ${header}
.else
_${group}INCS+= ${header}
.endif
-.endfor
+.endfor # header in ${${group}}
.if !empty(_${group}INCS)
stage_files.${group}: ${_${group}INCS}
stage_includes: stage_files.${group}
@@ -75,16 +79,16 @@ stage_includes: stage_files.${group}
installincludes: _${group}INS
_${group}INS: ${_${group}INCS}
.if defined(${group}NAME)
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
+ ${INSTALL} ${${group}TAG_ARGS} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME}
.else
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
+ ${INSTALL} ${${group}TAG_ARGS} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
${.ALLSRC} ${DESTDIR}${${group}DIR}/
.endif
-.endif
+.endif # !empty(_${group}INCS)
.endif # defined(${group}) && !empty(${group})
-.endfor
+.endfor # group in ${INCSGROUPS}
.if defined(INCSLINKS) && !empty(INCSLINKS)
installincludes:
More information about the dev-commits-src-all
mailing list