Now when a lib is marked as PRIVATELIB it is renamed into libprivate$foo instead of being installed in /usr/lib/private and playing with rpath. Also allow to install headers for PRIVATELIBS in that case the headers will be installed in /usr/include/private/$foo Keep the headers under a private namespace to prevent third party build system to easily find them to ensure they are only used on purpose. This allows for non base applications to statically link against a library in base which is linked to a privatelib Treating PRIVATELIBS as regular libraries allows to push them into our current compatX packages if needed. While here finish promotion of libevent as PRIVATELIB Install header for bsdstat and libucl Differential Revision: https://reviews.freebsd.org/D2365 Reviewed by: brooks, des Discussed with: imp
85 lines
2.1 KiB
Makefile
85 lines
2.1 KiB
Makefile
# $FreeBSD$
|
|
|
|
.if !target(__<bsd.init.mk>__)
|
|
.error bsd.incs.mk cannot be included directly.
|
|
.endif
|
|
|
|
.if ${MK_INCLUDES} != "no"
|
|
|
|
INCSGROUPS?= INCS
|
|
|
|
.if !target(buildincludes)
|
|
.for group in ${INCSGROUPS}
|
|
buildincludes: ${${group}}
|
|
.endfor
|
|
.endif
|
|
|
|
all: buildincludes
|
|
|
|
.if !target(installincludes)
|
|
.for group in ${INCSGROUPS}
|
|
.if defined(${group}) && !empty(${group})
|
|
|
|
${group}OWN?= ${BINOWN}
|
|
${group}GRP?= ${BINGRP}
|
|
${group}MODE?= ${NOBINMODE}
|
|
${group}DIR?= ${INCLUDEDIR}${PRIVATELIB:D/private/${LIB}}
|
|
|
|
_${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})
|
|
${group}OWN_${header:T}?= ${${group}OWN}
|
|
${group}GRP_${header:T}?= ${${group}GRP}
|
|
${group}MODE_${header:T}?= ${${group}MODE}
|
|
${group}DIR_${header:T}?= ${${group}DIR}
|
|
.if defined(${group}NAME)
|
|
${group}NAME_${header:T}?= ${${group}NAME}
|
|
.else
|
|
${group}NAME_${header:T}?= ${header:T}
|
|
.endif
|
|
installincludes: _${group}INS_${header:T}
|
|
_${group}INS_${header:T}: ${header}
|
|
${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \
|
|
-g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \
|
|
${.ALLSRC} \
|
|
${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}}
|
|
.else
|
|
_${group}INCS+= ${header}
|
|
.endif
|
|
.endfor
|
|
.if !empty(_${group}INCS)
|
|
installincludes: _${group}INS
|
|
_${group}INS: ${_${group}INCS}
|
|
.if defined(${group}NAME)
|
|
${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
|
|
${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME}
|
|
.else
|
|
${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
|
|
${.ALLSRC} ${DESTDIR}${${group}DIR}
|
|
.endif
|
|
.endif
|
|
|
|
.endif # defined(${group}) && !empty(${group})
|
|
.endfor
|
|
|
|
.if defined(INCSLINKS) && !empty(INCSLINKS)
|
|
installincludes:
|
|
@set ${INCSLINKS}; \
|
|
while test $$# -ge 2; do \
|
|
l=$$1; \
|
|
shift; \
|
|
t=${DESTDIR}$$1; \
|
|
shift; \
|
|
${ECHO} $$t -\> $$l; \
|
|
${INSTALL_SYMLINK} $$l $$t; \
|
|
done; true
|
|
.endif
|
|
.endif # !target(installincludes)
|
|
|
|
realinstall: installincludes
|
|
.ORDER: beforeinstall installincludes
|
|
|
|
.endif # ${MK_TOOLCHAIN} != "no"
|