1# $FreeBSD$ 2 3.if !target(__<bsd.init.mk>__) 4.error bsd.files.mk cannot be included directly. 5.endif 6 7.if !target(__<bsd.files.mk>__) 8__<bsd.files.mk>__: 9 10FILESGROUPS?= FILES 11 12.for group in ${FILESGROUPS} 13buildfiles: ${${group}} 14.endfor 15 16all: buildfiles 17 18.for group in ${FILESGROUPS} 19.if defined(${group}) && !empty(${group}) 20installfiles: installfiles-${group} 21 22${group}OWN?= ${SHAREOWN} 23${group}GRP?= ${SHAREGRP} 24${group}MODE?= ${SHAREMODE} 25${group}DIR?= ${BINDIR} 26 27_${group}FILES= 28.for file in ${${group}} 29.if defined(${group}OWN_${file:T}) || defined(${group}GRP_${file:T}) || \ 30 defined(${group}MODE_${file:T}) || defined(${group}DIR_${file:T}) || \ 31 defined(${group}NAME_${file:T}) 32${group}OWN_${file:T}?= ${${group}OWN} 33${group}GRP_${file:T}?= ${${group}GRP} 34${group}MODE_${file:T}?= ${${group}MODE} 35${group}DIR_${file:T}?= ${${group}DIR} 36.if defined(${group}NAME) 37${group}NAME_${file:T}?= ${${group}NAME} 38.else 39${group}NAME_${file:T}?= ${file:T} 40.endif 41installfiles-${group}: _${group}INS_${file:T} 42_${group}INS_${file:T}: ${file} 43 ${INSTALL} -o ${${group}OWN_${.ALLSRC:T}} \ 44 -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ 45 ${.ALLSRC} \ 46 ${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}} 47.else 48_${group}FILES+= ${file} 49.endif 50.endfor 51.if !empty(_${group}FILES) 52installfiles-${group}: _${group}INS 53_${group}INS: ${_${group}FILES} 54.if defined(${group}NAME) 55 ${INSTALL} -o ${${group}OWN} -g ${${group}GRP} \ 56 -m ${${group}MODE} ${.ALLSRC} \ 57 ${DESTDIR}${${group}DIR}/${${group}NAME} 58.else 59 ${INSTALL} -o ${${group}OWN} -g ${${group}GRP} \ 60 -m ${${group}MODE} ${.ALLSRC} ${DESTDIR}${${group}DIR} 61.endif 62.endif 63 64.endif # defined(${group}) && !empty(${group}) 65.endfor 66 67realinstall: installfiles 68.ORDER: beforeinstall installfiles 69 70.endif # !target(__<bsd.files.mk>__) 71