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
This commit is contained in:
Emmanuel Vadot 2020-12-14 18:53:34 +01:00 committed by Emmanuel Vadot
parent e3ff9a1f2e
commit 53a27d8955

View File

@ -8,13 +8,6 @@
INCSGROUPS?= INCS 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) .if !target(buildincludes)
.for group in ${INCSGROUPS} .for group in ${INCSGROUPS}
buildincludes: ${${group}} buildincludes: ${${group}}
@ -37,6 +30,17 @@ STAGE_SETS+= ${group:C,[/*],_,g}
STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR}
STAGE_SYMLINKS_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP} 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= _${group}INCS=
.for header in ${${group}} .for header in ${${group}}
.if defined(${group}OWN_${header:T}) || defined(${group}GRP_${header:T}) || \ .if defined(${group}OWN_${header:T}) || defined(${group}GRP_${header:T}) || \
@ -67,7 +71,7 @@ _${group}INS_${header:T}: ${header}
.else .else
_${group}INCS+= ${header} _${group}INCS+= ${header}
.endif .endif
.endfor .endfor # header in ${${group}}
.if !empty(_${group}INCS) .if !empty(_${group}INCS)
stage_files.${group}: ${_${group}INCS} stage_files.${group}: ${_${group}INCS}
stage_includes: stage_files.${group} stage_includes: stage_files.${group}
@ -75,16 +79,16 @@ stage_includes: stage_files.${group}
installincludes: _${group}INS installincludes: _${group}INS
_${group}INS: ${_${group}INCS} _${group}INS: ${_${group}INCS}
.if defined(${group}NAME) .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} ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME}
.else .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}/ ${.ALLSRC} ${DESTDIR}${${group}DIR}/
.endif .endif
.endif .endif # !empty(_${group}INCS)
.endif # defined(${group}) && !empty(${group}) .endif # defined(${group}) && !empty(${group})
.endfor .endfor # group in ${INCSGROUPS}
.if defined(INCSLINKS) && !empty(INCSLINKS) .if defined(INCSLINKS) && !empty(INCSLINKS)
installincludes: installincludes: