1# $FreeBSD$ 2 3.if !target(__<bsd.init.mk>__) 4.error bsd.conf.mk cannot be included directly. 5.endif 6 7.if ${MK_INCLUDES} != "no" 8CONFGROUPS?= CONFS 9 10.if !target(buildconfig) 11.for group in ${CONFSGROUPS} 12buildconfig: ${${group}} 13.endfor 14.endif 15 16all: buildconfig 17 18.if !target(installconfig) 19.for group in ${CONFGROUPS} 20.if defined(${group}) && !empty(${group}) 21 22${group}OWN?= ${SHAREOWN} 23${group}GRP?= ${SHAREGRP} 24${group}MODE?= ${CONFMODE} 25${group}DIR?= ${CONFIGDIR}/ 26STAGE_SETS+= ${group} 27STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} 28STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} 29 30_${group}CONFS= 31.for cnf in ${${group}} 32.if defined(${group}OWN_${cnf:T}) || defined(${group}GRP_${cnf:T}) || \ 33 defined(${group}MODE_${cnf:T}) || defined(${group}DIR_${cnf:T}) || \ 34 defined(${group}NAME_${cnf:T}) || defined(${group}NAME) 35${group}OWN_${cnf:T}?= ${${group}OWN} 36${group}GRP_${cnf:T}?= ${${group}GRP} 37${group}MODE_${cnf:T}?= ${${group}MODE} 38${group}DIR_${cnf:T}?= ${${group}DIR} 39.if defined(${group}NAME) 40${group}NAME_${cnf:T}?= ${${group}NAME} 41.else 42${group}NAME_${cnf:T}?= ${cnf:T} 43.endif 44STAGE_AS_SETS+= ${cnf:T} 45STAGE_AS_${cnf:T}= ${${group}NAME_${cnf:T}} 46# XXX {group}OWN,GRP,MODE 47STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${group}DIR_${cnf:T}} 48stage_as.${cnf:T}: ${cnf} 49stage_config: stage_as.${cnf:T} 50 51installconfig: _${group}INS_${cnf:T} 52_${group}INS_${cnf:T}: ${cnf} 53 ${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \ 54 -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ 55 ${.ALLSRC} \ 56 ${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}} 57.else 58_${group}CONFS+= ${cnf} 59.endif 60.endfor 61.if !empty(_${group}CONFS) 62stage_files.${group}: ${_${group}CONFS} 63stage_config: stage_files.${group} 64 65installconfig: _${group}INS 66_${group}INS: ${_${group}CONFS} 67.if defined(${group}NAME) 68 ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ 69 ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME} 70.else 71 ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ 72 ${.ALLSRC} ${DESTDIR}${${group}DIR} 73.endif 74.endif 75 76.endif # defined(${group}) && !empty(${group}) 77.endfor 78 79.endif # !target(installconfig) 80 81.if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD) 82.if !defined(NO_STAGE_CONFIG) 83STAGE_TARGETS+= stage_config 84.endif 85.endif 86 87.endif # ${MK_TOOLCHAIN} != "no" 88