diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index 416993ee3fa4..2db49af5e613 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -127,6 +127,20 @@ _manpages: ${MAN} ZEXT= ${MCOMPRESS_EXT} .if defined(MAN) && !empty(MAN) +.if ${MK_STAGING} +staging: stage_files +_mansets:= ${MAN:E:O:u:@s@man$s@} +STAGE_SETS+= ${_mansets} +.for _page in ${MAN} +stage_files.man${_page:T:E}: ${_page} +STAGE_DIR.man${_page:T:E}?= ${STAGE_OBJTOP}${MANDIR}${_page:T:E}${MANSUBDIR} +.endfor +.if !empty(MLINKS) +staging: stage_links +STAGE_LINKS.${_mansets:[1]} := ${MLINKS:S,^,${MANDIR}${_mansets:[1]:S,man,,}${MANSUBDIR}/,} +.endif +.endif + CLEANFILES+= ${MAN:T:S/$/${MCOMPRESS_EXT}/g} CLEANFILES+= ${MAN:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g} .for __page in ${MAN}