2002-05-12 16:01:00 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.if !target(__<bsd.init.mk>__)
|
|
|
|
.error bsd.incs.mk cannot be included directly.
|
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if !defined(NO_INCS) && ${MK_TOOLCHAIN} != "no"
|
2006-02-03 16:50:32 +00:00
|
|
|
|
2002-05-12 16:01:00 +00:00
|
|
|
INCSGROUPS?= INCS
|
|
|
|
|
2002-05-15 16:19:54 +00:00
|
|
|
.if !target(buildincludes)
|
2002-05-12 16:01:00 +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
|
|
|
|
|
2002-05-15 16:19:54 +00:00
|
|
|
all: buildincludes
|
2002-05-12 16:01:00 +00:00
|
|
|
|
2002-05-15 16:19:54 +00:00
|
|
|
.if !target(installincludes)
|
2002-05-12 16:01:00 +00:00
|
|
|
.for group in ${INCSGROUPS}
|
|
|
|
.if defined(${group}) && !empty(${group})
|
|
|
|
|
|
|
|
${group}OWN?= ${BINOWN}
|
|
|
|
${group}GRP?= ${BINGRP}
|
|
|
|
${group}MODE?= ${NOBINMODE}
|
|
|
|
${group}DIR?= ${INCLUDEDIR}
|
2012-08-22 19:25:57 +00:00
|
|
|
STAGE_SETS+= ${group}
|
|
|
|
STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR}
|
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
|
2012-08-22 19:25:57 +00:00
|
|
|
STAGE_AS_SETS+= ${group}
|
|
|
|
STAGE_AS_${header:T}= ${${group}NAME_${header:T}}
|
|
|
|
stage_as.${group}: ${header}
|
|
|
|
|
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}
|
|
|
|
${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)
|
2012-08-22 19:25:57 +00:00
|
|
|
stage_files.${group}: ${_${group}INCS}
|
|
|
|
|
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)
|
|
|
|
${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
|
|
|
|
|
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:
|
2002-05-12 16:01:00 +00:00
|
|
|
@set ${INCSLINKS}; \
|
|
|
|
while test $$# -ge 2; do \
|
|
|
|
l=$$1; \
|
|
|
|
shift; \
|
|
|
|
t=${DESTDIR}$$1; \
|
|
|
|
shift; \
|
|
|
|
${ECHO} $$t -\> $$l; \
|
|
|
|
ln -fs $$l $$t; \
|
|
|
|
done; true
|
|
|
|
.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)
|
2012-08-22 19:25:57 +00:00
|
|
|
.if !target(stage_includes)
|
|
|
|
.if !empty(STAGE_SETS)
|
|
|
|
buildincludes: stage_files
|
|
|
|
.if !empty(STAGE_AS_SETS)
|
|
|
|
buildincludes: stage_as
|
|
|
|
.endif
|
2012-11-08 21:40:05 +00:00
|
|
|
.if !empty(INCSLINKS)
|
|
|
|
stage_files: stage_symlinks
|
|
|
|
STAGE_SYMLINKS.INCS= ${INCSLINKS:S,${INCSDIR}/,,}
|
|
|
|
.endif
|
2012-08-22 19:25:57 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.endif # !defined(NO_INCS) && ${MK_TOOLCHAIN} != "no"
|