2002-06-03 14:49:34 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.if !target(__<bsd.init.mk>__)
|
|
|
|
.error bsd.files.mk cannot be included directly.
|
|
|
|
.endif
|
|
|
|
|
2014-06-09 14:36:49 +00:00
|
|
|
.if !target(__<bsd.files.mk>__)
|
|
|
|
__<bsd.files.mk>__:
|
|
|
|
|
2002-06-03 14:49:34 +00:00
|
|
|
FILESGROUPS?= FILES
|
|
|
|
|
|
|
|
.for group in ${FILESGROUPS}
|
2015-08-27 01:52:45 +00:00
|
|
|
# Add in foo.yes and remove duplicates from all the groups
|
|
|
|
${${group}}:= ${${group}} ${${group}.yes}
|
|
|
|
${${group}}:= ${${group}:O:u}
|
2002-06-03 14:49:34 +00:00
|
|
|
buildfiles: ${${group}}
|
|
|
|
.endfor
|
|
|
|
|
2016-02-26 22:13:48 +00:00
|
|
|
.if !defined(_SKIP_BUILD)
|
2002-06-03 14:49:34 +00:00
|
|
|
all: buildfiles
|
2016-02-26 22:13:48 +00:00
|
|
|
.endif
|
2002-06-03 14:49:34 +00:00
|
|
|
|
|
|
|
.for group in ${FILESGROUPS}
|
|
|
|
.if defined(${group}) && !empty(${group})
|
2013-10-25 05:11:10 +00:00
|
|
|
installfiles: installfiles-${group}
|
2002-06-03 14:49:34 +00:00
|
|
|
|
|
|
|
${group}OWN?= ${SHAREOWN}
|
|
|
|
${group}GRP?= ${SHAREGRP}
|
|
|
|
${group}MODE?= ${SHAREMODE}
|
|
|
|
${group}DIR?= ${BINDIR}
|
2012-08-22 19:25:57 +00:00
|
|
|
.if !make(buildincludes)
|
|
|
|
STAGE_SETS+= ${group}
|
|
|
|
.endif
|
|
|
|
STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR}
|
2002-06-03 14:49:34 +00:00
|
|
|
|
|
|
|
_${group}FILES=
|
|
|
|
.for file in ${${group}}
|
|
|
|
.if defined(${group}OWN_${file:T}) || defined(${group}GRP_${file:T}) || \
|
|
|
|
defined(${group}MODE_${file:T}) || defined(${group}DIR_${file:T}) || \
|
2015-10-26 23:28:35 +00:00
|
|
|
defined(${group}NAME_${file:T}) || defined(${group}NAME)
|
2002-06-03 14:49:34 +00:00
|
|
|
${group}OWN_${file:T}?= ${${group}OWN}
|
|
|
|
${group}GRP_${file:T}?= ${${group}GRP}
|
|
|
|
${group}MODE_${file:T}?= ${${group}MODE}
|
|
|
|
${group}DIR_${file:T}?= ${${group}DIR}
|
|
|
|
.if defined(${group}NAME)
|
|
|
|
${group}NAME_${file:T}?= ${${group}NAME}
|
|
|
|
.else
|
|
|
|
${group}NAME_${file:T}?= ${file:T}
|
|
|
|
.endif
|
2012-08-22 19:25:57 +00:00
|
|
|
.if !make(buildincludes)
|
2015-09-25 05:15:27 +00:00
|
|
|
STAGE_AS_SETS+= ${file:T}
|
2012-08-22 19:25:57 +00:00
|
|
|
.endif
|
|
|
|
STAGE_AS_${file:T}= ${${group}NAME_${file:T}}
|
2015-09-25 05:15:27 +00:00
|
|
|
# XXX {group}OWN,GRP,MODE
|
|
|
|
STAGE_DIR.${file:T}= ${STAGE_OBJTOP}${${group}DIR_${file:T}}
|
|
|
|
stage_as.${file:T}: ${file}
|
2012-08-22 19:25:57 +00:00
|
|
|
|
2013-10-25 05:11:10 +00:00
|
|
|
installfiles-${group}: _${group}INS_${file:T}
|
2002-06-03 14:49:34 +00:00
|
|
|
_${group}INS_${file:T}: ${file}
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${${group}OWN_${.ALLSRC:T}} \
|
2002-06-03 14:49:34 +00:00
|
|
|
-g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \
|
|
|
|
${.ALLSRC} \
|
|
|
|
${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}}
|
|
|
|
.else
|
|
|
|
_${group}FILES+= ${file}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.if !empty(_${group}FILES)
|
2012-08-22 19:25:57 +00:00
|
|
|
stage_files.${group}: ${_${group}FILES}
|
|
|
|
|
2013-10-25 05:11:10 +00:00
|
|
|
installfiles-${group}: _${group}INS
|
2002-06-03 14:49:34 +00:00
|
|
|
_${group}INS: ${_${group}FILES}
|
|
|
|
.if defined(${group}NAME)
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${${group}OWN} -g ${${group}GRP} \
|
2002-06-03 14:49:34 +00:00
|
|
|
-m ${${group}MODE} ${.ALLSRC} \
|
|
|
|
${DESTDIR}${${group}DIR}/${${group}NAME}
|
|
|
|
.else
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${${group}OWN} -g ${${group}GRP} \
|
2015-10-15 22:49:56 +00:00
|
|
|
-m ${${group}MODE} ${.ALLSRC} ${DESTDIR}${${group}DIR}/
|
2002-06-03 14:49:34 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2005-04-11 07:13:29 +00:00
|
|
|
.endif # defined(${group}) && !empty(${group})
|
2002-06-03 14:49:34 +00:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
realinstall: installfiles
|
2002-07-03 12:28:03 +00:00
|
|
|
.ORDER: beforeinstall installfiles
|
2012-08-22 19:25:57 +00:00
|
|
|
|
|
|
|
.if ${MK_STAGING} != "no"
|
|
|
|
.if !empty(STAGE_SETS)
|
|
|
|
buildfiles: stage_files
|
|
|
|
.if !empty(STAGE_AS_SETS)
|
|
|
|
buildfiles: stage_as
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endif
|
2014-08-19 06:50:54 +00:00
|
|
|
|
2014-06-09 14:36:49 +00:00
|
|
|
.endif # !target(__<bsd.files.mk>__)
|