2002-05-12 16:01:00 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.if !target(__<bsd.init.mk>__)
|
|
|
|
.error bsd.incs.mk cannot be included directly.
|
|
|
|
.endif
|
|
|
|
|
2014-11-18 17:06:44 +00:00
|
|
|
.if ${MK_INCLUDES} != "no"
|
2006-02-03 16:50:32 +00:00
|
|
|
|
2002-05-12 16:01:00 +00:00
|
|
|
INCSGROUPS?= INCS
|
|
|
|
|
2015-02-13 00:16:05 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
.if !defined(TAGS) || ! ${TAGS:Mpackage=*}
|
|
|
|
TAGS+= package=${PACKAGE:Uruntime}
|
|
|
|
.endif
|
|
|
|
TAG_ARGS= -T ${TAGS:[*]:S/ /,/g}
|
|
|
|
.endif
|
|
|
|
|
2002-05-15 16:19:54 +00:00
|
|
|
.if !target(buildincludes)
|
2016-12-03 05:29:31 +00:00
|
|
|
.for group in ${INCSGROUPS}
|
2002-05-15 16:19:54 +00:00
|
|
|
buildincludes: ${${group}}
|
2002-05-12 16:01:00 +00:00
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
2016-02-26 22:13:48 +00:00
|
|
|
.if !defined(_SKIP_BUILD)
|
2002-05-15 16:19:54 +00:00
|
|
|
all: buildincludes
|
2016-02-26 22:13:48 +00:00
|
|
|
.endif
|
2002-05-12 16:01:00 +00:00
|
|
|
|
2002-05-15 16:19:54 +00:00
|
|
|
.if !target(installincludes)
|
2016-12-03 05:29:31 +00:00
|
|
|
.for group in ${INCSGROUPS}
|
2002-05-12 16:01:00 +00:00
|
|
|
.if defined(${group}) && !empty(${group})
|
|
|
|
|
|
|
|
${group}OWN?= ${BINOWN}
|
|
|
|
${group}GRP?= ${BINGRP}
|
|
|
|
${group}MODE?= ${NOBINMODE}
|
2015-05-04 16:28:54 +00:00
|
|
|
${group}DIR?= ${INCLUDEDIR}${PRIVATELIB:D/private/${LIB}}
|
2016-12-03 05:29:35 +00:00
|
|
|
STAGE_SETS+= ${group:C,[/*],_,g}
|
|
|
|
STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR}
|
|
|
|
STAGE_SYMLINKS_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}
|
2002-05-12 16:01:00 +00:00
|
|
|
|
|
|
|
_${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}) || \
|
2012-11-08 21:40:05 +00:00
|
|
|
defined(${group}NAME_${header:T}) || defined(${group}NAME)
|
2002-05-12 16:01:00 +00:00
|
|
|
${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
|
2015-09-25 05:15:27 +00:00
|
|
|
STAGE_AS_SETS+= ${header:T}
|
2012-08-22 19:25:57 +00:00
|
|
|
STAGE_AS_${header:T}= ${${group}NAME_${header:T}}
|
2015-09-25 05:15:27 +00:00
|
|
|
# XXX {group}OWN,GRP,MODE
|
|
|
|
STAGE_DIR.${header:T}= ${STAGE_OBJTOP}${${group}DIR_${header:T}}
|
|
|
|
stage_as.${header:T}: ${header}
|
|
|
|
stage_includes: stage_as.${header:T}
|
2012-08-22 19:25:57 +00:00
|
|
|
|
2002-05-15 16:19:54 +00:00
|
|
|
installincludes: _${group}INS_${header:T}
|
2002-05-12 16:01:00 +00:00
|
|
|
_${group}INS_${header:T}: ${header}
|
2015-10-07 06:31:01 +00:00
|
|
|
${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \
|
2002-05-12 16:01:00 +00:00
|
|
|
-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)
|
2012-08-22 19:25:57 +00:00
|
|
|
stage_files.${group}: ${_${group}INCS}
|
2014-05-16 14:47:18 +00:00
|
|
|
stage_includes: stage_files.${group}
|
2012-08-22 19:25:57 +00:00
|
|
|
|
2002-05-15 16:19:54 +00:00
|
|
|
installincludes: _${group}INS
|
2002-05-12 16:01:00 +00:00
|
|
|
_${group}INS: ${_${group}INCS}
|
|
|
|
.if defined(${group}NAME)
|
2015-02-13 00:16:05 +00:00
|
|
|
${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
|
2002-05-12 16:01:00 +00:00
|
|
|
${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME}
|
|
|
|
.else
|
2015-02-13 00:16:05 +00:00
|
|
|
${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
|
2015-10-15 22:49:56 +00:00
|
|
|
${.ALLSRC} ${DESTDIR}${${group}DIR}/
|
2002-05-12 16:01:00 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2005-04-11 07:13:29 +00:00
|
|
|
.endif # defined(${group}) && !empty(${group})
|
2002-05-12 16:01:00 +00:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
.if defined(INCSLINKS) && !empty(INCSLINKS)
|
2002-05-15 16:19:54 +00:00
|
|
|
installincludes:
|
2015-06-21 22:27:52 +00:00
|
|
|
.for s t in ${INCSLINKS}
|
2016-02-08 12:16:01 +00:00
|
|
|
${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${s} ${DESTDIR}${t}
|
2015-06-21 22:27:52 +00:00
|
|
|
.endfor
|
2002-05-12 16:01:00 +00:00
|
|
|
.endif
|
2005-04-11 07:13:29 +00:00
|
|
|
.endif # !target(installincludes)
|
2002-05-15 16:19:54 +00:00
|
|
|
|
|
|
|
realinstall: installincludes
|
2002-07-03 12:28:03 +00:00
|
|
|
.ORDER: beforeinstall installincludes
|
2006-02-03 16:50:32 +00:00
|
|
|
|
2012-11-08 21:40:05 +00:00
|
|
|
.if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD)
|
2014-05-16 14:47:18 +00:00
|
|
|
.if !defined(NO_STAGE_INCLUDES)
|
2015-10-07 00:24:27 +00:00
|
|
|
STAGE_TARGETS+= stage_includes
|
2012-11-08 21:40:05 +00:00
|
|
|
.if !empty(INCSLINKS)
|
2015-10-07 00:24:27 +00:00
|
|
|
STAGE_TARGETS+= stage_symlinks
|
2013-02-16 01:20:56 +00:00
|
|
|
STAGE_SYMLINKS.INCS= ${INCSLINKS}
|
2012-08-22 19:25:57 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2015-10-14 00:43:29 +00:00
|
|
|
.endif # ${MK_INCLUDES} != "no"
|