2 .if !target(__<bsd.init.mk>__)
3 . error bsd.conf.mk cannot be included directly.
6 .if !target(__<bsd.confs.mk>__)
7 . if target(__<bsd.dirs.mk>__)
8 . error bsd.dirs.mk must be included after bsd.confs.mk.
15 . if !target(buildconfig)
16 . for group in ${CONFGROUPS}
17 buildconfig: ${${group}}
21 . if !defined(_SKIP_BUILD)
25 . for group in ${CONFGROUPS}
26 . if defined(${group}) && !empty(${group})
28 . if !target(afterinstallconfig)
31 . if !target(beforeinstallconfig)
34 installconfig: beforeinstallconfig realinstallconfig afterinstallconfig
35 .ORDER: beforeinstallconfig realinstallconfig afterinstallconfig
37 ${group}OWN?= ${SHAREOWN}
38 ${group}GRP?= ${SHAREGRP}
39 ${group}MODE?= ${CONFMODE}
40 ${group}DIR?= ${CONFDIR}
41 STAGE_SETS+= ${group:C,[/*],_,g}
44 . if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*}
45 . if defined(${group}PACKAGE)
46 ${group}TAGS+= package=${${group}PACKAGE:Uutilities}
48 ${group}TAGS+= package=${PACKAGE:Uutilities}
52 ${group}TAG_ARGS= -T ${${group}TAGS:[*]:S/ /,/g}
56 . if ${${group}DIR:S/^\///} == ${${group}DIR}
57 # ${group}DIR specifies a variable that specifies a path
59 _${group}DIR= ${${group}DIR}
61 # ${group}DIR specifies a path
63 _${group}DIR= ${group}DIR
66 STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${_${group}DIR}}
68 . for cnf in ${${group}}
69 ${group}OWN_${cnf}?= ${${group}OWN}
70 ${group}GRP_${cnf}?= ${${group}GRP}
71 ${group}MODE_${cnf}?= ${${group}MODE}
72 ${group}DIR_${cnf}?= ${${group}DIR}
73 . if defined(${group}NAME)
74 ${group}NAME_${cnf}?= ${${group}NAME}
76 ${group}NAME_${cnf}?= ${cnf:T}
80 # Determine the directory for the current file. Default to the parent group
81 # DIR, then check to see how to pass that variable on below.
82 ${group}DIR_${cnf}?= ${${group}DIR}
83 . if ${${group}DIR_${cnf}:S/^\///} == ${${group}DIR_${cnf}}
84 # DIR specifies a variable that specifies a path
85 _${group}DIR_${cnf}= ${${group}DIR_${cnf}}
87 # DIR directly specifies a path
88 _${group}DIR_${cnf}= ${group}DIR_${cnf}
90 ${group}PREFIX_${cnf}= ${DESTDIR}${${_${group}DIR_${cnf}}}
92 # Append DIR to DIRS if not already in place -- DIRS is already filtered, so
93 # this is primarily to ease inspection.
97 . if ${DIRS:M${_${group}DIR_${cnf}}} == ""
98 . if ${_DIRS:M${${_${group}DIR_${cnf}}}} == ""
99 DIRS+= ${_${group}DIR_${cnf}}
101 _${group}DIR_${cnf}= ${group}DIR
105 . if defined(${group}NAME)
106 ${group}NAME_${cnf}?= ${${group}NAME}
108 ${group}NAME_${cnf}?= ${cnf:T}
109 . endif # defined(${group}NAME)
111 # Work around a bug with install(1) -C and /dev/null
112 . if ${cnf} == "/dev/null"
118 STAGE_AS_SETS+= ${cnf:T}
119 STAGE_AS_${cnf:T}= ${${group}NAME_${cnf:T}}
120 # XXX {group}OWN,GRP,MODE
121 STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${_${group}DIR_${cnf}}}
122 stage_as.${cnf:T}: ${cnf}
124 realinstallconfig: installdirs-${_${group}DIR_${cnf}} _${group}INS_${cnf:T}
125 _${group}INS_${cnf:T}: ${cnf}
126 ${INSTALL} ${${group}TAG_ARGS} ${INSTALL_COPY} -o ${${group}OWN_${cnf}} \
127 -g ${${group}GRP_${cnf}} -m ${${group}MODE_${cnf}} \
128 ${.ALLSRC} ${${group}PREFIX_${cnf}}/${${group}NAME_${cnf}}
129 . endfor # for cnf in ${${group}}
131 . endif # defined(${group}) && !empty(${group})
134 .if ${MK_STAGING} != "no"
135 . if !empty(STAGE_SETS)
136 buildconfig: stage_files
138 . if !empty(STAGE_AS_SETS)
139 buildconfig: stage_as
145 .endif # !target(__<bsd.confs.mk>__)