summaryrefslogtreecommitdiff
path: root/share/mk/bsd.incs.mk
diff options
context:
space:
mode:
Diffstat (limited to 'share/mk/bsd.incs.mk')
-rw-r--r--share/mk/bsd.incs.mk23
1 files changed, 22 insertions, 1 deletions
diff --git a/share/mk/bsd.incs.mk b/share/mk/bsd.incs.mk
index cc65baf4059c..76372567ba7a 100644
--- a/share/mk/bsd.incs.mk
+++ b/share/mk/bsd.incs.mk
@@ -24,12 +24,15 @@ ${group}OWN?= ${BINOWN}
${group}GRP?= ${BINGRP}
${group}MODE?= ${NOBINMODE}
${group}DIR?= ${INCLUDEDIR}${PRIVATELIB:D/private/${LIB}}
+STAGE_SETS+= ${group}
+STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR}
+STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP}
_${group}INCS=
.for header in ${${group}}
.if defined(${group}OWN_${header:T}) || defined(${group}GRP_${header:T}) || \
defined(${group}MODE_${header:T}) || defined(${group}DIR_${header:T}) || \
- defined(${group}NAME_${header:T})
+ defined(${group}NAME_${header:T}) || defined(${group}NAME)
${group}OWN_${header:T}?= ${${group}OWN}
${group}GRP_${header:T}?= ${${group}GRP}
${group}MODE_${header:T}?= ${${group}MODE}
@@ -39,6 +42,11 @@ ${group}NAME_${header:T}?= ${${group}NAME}
.else
${group}NAME_${header:T}?= ${header:T}
.endif
+STAGE_AS_SETS+= ${group}
+STAGE_AS_${header:T}= ${${group}NAME_${header:T}}
+stage_as.${group}: ${header}
+stage_includes: stage_as.${group}
+
installincludes: _${group}INS_${header:T}
_${group}INS_${header:T}: ${header}
${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \
@@ -50,6 +58,9 @@ _${group}INCS+= ${header}
.endif
.endfor
.if !empty(_${group}INCS)
+stage_files.${group}: ${_${group}INCS}
+stage_includes: stage_files.${group}
+
installincludes: _${group}INS
_${group}INS: ${_${group}INCS}
.if defined(${group}NAME)
@@ -81,4 +92,14 @@ installincludes:
realinstall: installincludes
.ORDER: beforeinstall installincludes
+.if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD)
+.if !defined(NO_STAGE_INCLUDES)
+staging: stage_includes
+.if !empty(INCSLINKS)
+staging: stage_symlinks
+STAGE_SYMLINKS.INCS= ${INCSLINKS}
+.endif
+.endif
+.endif
+
.endif # ${MK_TOOLCHAIN} != "no"