2015-10-09 21:57:42 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.if !target(__<bsd.init.mk>__)
|
2018-07-24 16:34:58 +00:00
|
|
|
. error bsd.conf.mk cannot be included directly.
|
2015-10-09 21:57:42 +00:00
|
|
|
.endif
|
|
|
|
|
2018-07-24 16:34:58 +00:00
|
|
|
.if !target(__<bsd.confs.mk>__)
|
|
|
|
. if target(__<bsd.dirs.mk>__)
|
|
|
|
. error bsd.dirs.mk must be included after bsd.confs.mk.
|
|
|
|
. endif
|
|
|
|
|
|
|
|
__<bsd.confs.mk>__:
|
|
|
|
|
2015-10-09 21:57:42 +00:00
|
|
|
CONFGROUPS?= CONFS
|
|
|
|
|
2018-07-24 16:34:58 +00:00
|
|
|
. if !target(buildconfig)
|
|
|
|
. for group in ${CONFGROUPS}
|
2015-10-09 21:57:42 +00:00
|
|
|
buildconfig: ${${group}}
|
2018-07-24 16:34:58 +00:00
|
|
|
. endfor
|
|
|
|
. endif
|
2015-10-09 21:57:42 +00:00
|
|
|
|
2018-07-24 16:34:58 +00:00
|
|
|
. if !defined(_SKIP_BUILD)
|
2015-10-09 21:57:42 +00:00
|
|
|
all: buildconfig
|
2018-07-24 16:34:58 +00:00
|
|
|
. endif
|
|
|
|
|
2018-07-28 20:31:03 +00:00
|
|
|
. for group in ${CONFGROUPS}
|
|
|
|
. if defined(${group}) && !empty(${group})
|
2015-10-09 21:57:42 +00:00
|
|
|
|
2018-07-28 20:31:03 +00:00
|
|
|
. if !target(afterinstallconfig)
|
2018-07-24 16:34:58 +00:00
|
|
|
afterinstallconfig:
|
2018-07-28 20:31:03 +00:00
|
|
|
. endif
|
2018-08-28 22:22:06 +00:00
|
|
|
. if !target(beforeinstallconfig)
|
|
|
|
beforeinstallconfig:
|
|
|
|
. endif
|
|
|
|
installconfig: beforeinstallconfig realinstallconfig afterinstallconfig
|
|
|
|
.ORDER: beforeinstallconfig realinstallconfig afterinstallconfig
|
2015-10-09 21:57:42 +00:00
|
|
|
|
|
|
|
${group}OWN?= ${SHAREOWN}
|
|
|
|
${group}GRP?= ${SHAREGRP}
|
2015-10-09 22:15:31 +00:00
|
|
|
${group}MODE?= ${CONFMODE}
|
2015-10-27 23:49:32 +00:00
|
|
|
${group}DIR?= ${CONFDIR}
|
2016-12-03 05:29:35 +00:00
|
|
|
STAGE_SETS+= ${group:C,[/*],_,g}
|
2015-10-09 21:57:42 +00:00
|
|
|
|
2018-07-28 20:31:03 +00:00
|
|
|
. if defined(NO_ROOT)
|
|
|
|
. if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*}
|
|
|
|
. if defined(${${group}PACKAGE})
|
2018-07-24 16:34:58 +00:00
|
|
|
${group}TAGS+= package=${${group}PACKAGE:Uruntime}
|
2018-07-28 20:31:03 +00:00
|
|
|
. else
|
2018-07-24 16:34:58 +00:00
|
|
|
${group}TAGS+= package=${PACKAGE:Uruntime}
|
|
|
|
. endif
|
2018-07-28 20:31:03 +00:00
|
|
|
. endif
|
2018-07-24 16:34:58 +00:00
|
|
|
${group}TAGS+= config
|
|
|
|
${group}TAG_ARGS= -T ${${group}TAGS:[*]:S/ /,/g}
|
2018-07-28 20:31:03 +00:00
|
|
|
. endif
|
2018-07-24 16:34:58 +00:00
|
|
|
|
|
|
|
|
2018-07-28 20:31:03 +00:00
|
|
|
. if ${${group}DIR:S/^\///} == ${${group}DIR}
|
2018-07-24 16:34:58 +00:00
|
|
|
# ${group}DIR specifies a variable that specifies a path
|
|
|
|
DIRS+= ${${group}DIR}
|
|
|
|
_${group}DIR= ${${group}DIR}
|
2018-07-28 20:31:03 +00:00
|
|
|
. else
|
2018-07-24 16:34:58 +00:00
|
|
|
# ${group}DIR specifies a path
|
|
|
|
DIRS+= ${group}DIR
|
|
|
|
_${group}DIR= ${group}DIR
|
2018-07-28 20:31:03 +00:00
|
|
|
. endif
|
2018-07-24 16:34:58 +00:00
|
|
|
|
2019-01-15 23:37:49 +00:00
|
|
|
STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${_${group}DIR}}
|
2018-07-24 16:34:58 +00:00
|
|
|
|
2018-07-28 20:31:03 +00:00
|
|
|
. for cnf in ${${group}}
|
2018-07-24 16:34:58 +00:00
|
|
|
${group}OWN_${cnf}?= ${${group}OWN}
|
|
|
|
${group}GRP_${cnf}?= ${${group}GRP}
|
|
|
|
${group}MODE_${cnf}?= ${${group}MODE}
|
|
|
|
${group}DIR_${cnf}?= ${${group}DIR}
|
2018-07-28 20:31:03 +00:00
|
|
|
. if defined(${group}NAME)
|
2018-07-24 16:34:58 +00:00
|
|
|
${group}NAME_${cnf}?= ${${group}NAME}
|
2018-07-28 20:31:03 +00:00
|
|
|
. else
|
2018-07-24 16:34:58 +00:00
|
|
|
${group}NAME_${cnf}?= ${cnf:T}
|
2018-07-28 20:31:03 +00:00
|
|
|
. endif
|
2018-07-24 16:34:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Determine the directory for the current file. Default to the parent group
|
|
|
|
# DIR, then check to see how to pass that variable on below.
|
|
|
|
${group}DIR_${cnf}?= ${${group}DIR}
|
2018-07-28 20:31:03 +00:00
|
|
|
. if ${${group}DIR_${cnf}:S/^\///} == ${${group}DIR_${cnf}}
|
2018-07-24 16:34:58 +00:00
|
|
|
# DIR specifies a variable that specifies a path
|
|
|
|
_${group}DIR_${cnf}= ${${group}DIR_${cnf}}
|
2018-07-28 20:31:03 +00:00
|
|
|
. else
|
2018-07-24 16:34:58 +00:00
|
|
|
# DIR directly specifies a path
|
|
|
|
_${group}DIR_${cnf}= ${group}DIR_${cnf}
|
2018-07-28 20:31:03 +00:00
|
|
|
. endif
|
2018-07-24 16:34:58 +00:00
|
|
|
${group}PREFIX_${cnf}= ${DESTDIR}${${_${group}DIR_${cnf}}}
|
|
|
|
|
|
|
|
# Append DIR to DIRS if not already in place -- DIRS is already filtered, so
|
|
|
|
# this is primarily to ease inspection.
|
2018-07-28 20:31:03 +00:00
|
|
|
. for d in ${DIRS}
|
2018-07-24 16:34:58 +00:00
|
|
|
_DIRS+= ${${d}}
|
2018-07-28 20:31:03 +00:00
|
|
|
. endfor
|
|
|
|
. if ${DIRS:M${_${group}DIR_${cnf}}} == ""
|
|
|
|
. if ${_DIRS:M${${_${group}DIR_${cnf}}}} == ""
|
2018-07-24 16:34:58 +00:00
|
|
|
DIRS+= ${_${group}DIR_${cnf}}
|
2018-07-28 20:31:03 +00:00
|
|
|
. else
|
2018-07-24 16:34:58 +00:00
|
|
|
_${group}DIR_${cnf}= ${group}DIR
|
|
|
|
. endif
|
2018-07-28 20:31:03 +00:00
|
|
|
. endif
|
2018-07-24 16:34:58 +00:00
|
|
|
|
2018-07-28 20:31:03 +00:00
|
|
|
. if defined(${group}NAME)
|
2018-07-24 16:34:58 +00:00
|
|
|
${group}NAME_${cnf}?= ${${group}NAME}
|
2018-07-28 20:31:03 +00:00
|
|
|
. else
|
2018-07-24 16:34:58 +00:00
|
|
|
${group}NAME_${cnf}?= ${cnf:T}
|
2018-07-28 20:31:03 +00:00
|
|
|
. endif # defined(${group}NAME)
|
2018-07-24 16:34:58 +00:00
|
|
|
|
2018-07-27 22:46:42 +00:00
|
|
|
# Work around a bug with install(1) -C and /dev/null
|
2018-07-28 20:31:03 +00:00
|
|
|
. if ${cnf} == "/dev/null"
|
2018-07-27 22:46:42 +00:00
|
|
|
INSTALL_COPY=
|
2018-07-28 20:31:03 +00:00
|
|
|
. else
|
2018-07-27 22:46:42 +00:00
|
|
|
INSTALL_COPY= -C
|
2018-07-28 20:31:03 +00:00
|
|
|
. endif
|
2018-07-24 16:34:58 +00:00
|
|
|
|
2015-10-09 21:57:42 +00:00
|
|
|
STAGE_AS_SETS+= ${cnf:T}
|
|
|
|
STAGE_AS_${cnf:T}= ${${group}NAME_${cnf:T}}
|
|
|
|
# XXX {group}OWN,GRP,MODE
|
2019-01-15 23:37:49 +00:00
|
|
|
STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${_${group}DIR_${cnf}}}
|
2015-10-09 21:57:42 +00:00
|
|
|
stage_as.${cnf:T}: ${cnf}
|
|
|
|
|
2018-07-24 16:34:58 +00:00
|
|
|
realinstallconfig: installdirs-${_${group}DIR_${cnf}} _${group}INS_${cnf:T}
|
2015-10-09 21:57:42 +00:00
|
|
|
_${group}INS_${cnf:T}: ${cnf}
|
2018-07-27 22:46:42 +00:00
|
|
|
${INSTALL} ${${group}TAG_ARGS} ${INSTALL_COPY} -o ${${group}OWN_${cnf}} \
|
2018-07-24 16:34:58 +00:00
|
|
|
-g ${${group}GRP_${cnf}} -m ${${group}MODE_${cnf}} \
|
|
|
|
${.ALLSRC} ${${group}PREFIX_${cnf}}/${${group}NAME_${cnf}}
|
2018-07-28 20:31:03 +00:00
|
|
|
. endfor # for cnf in ${${group}}
|
2015-10-09 21:57:42 +00:00
|
|
|
|
2018-07-24 16:34:58 +00:00
|
|
|
. endif # defined(${group}) && !empty(${group})
|
|
|
|
. endfor
|
2015-10-09 21:57:42 +00:00
|
|
|
|
2015-10-27 01:29:38 +00:00
|
|
|
.if ${MK_STAGING} != "no"
|
2018-07-24 16:34:58 +00:00
|
|
|
. if !empty(STAGE_SETS)
|
2015-10-27 01:29:38 +00:00
|
|
|
buildconfig: stage_files
|
2018-07-24 16:34:58 +00:00
|
|
|
. if !empty(STAGE_AS_SETS)
|
2015-10-27 01:29:38 +00:00
|
|
|
buildconfig: stage_as
|
2018-07-24 16:34:58 +00:00
|
|
|
. endif
|
|
|
|
. endif
|
2015-10-27 01:29:38 +00:00
|
|
|
.endif
|
|
|
|
|
2018-07-24 16:34:58 +00:00
|
|
|
.endif # !target(__<bsd.confs.mk>__)
|