From owner-svn-src-head@freebsd.org Tue Jul 24 16:34:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A27D21050188; Tue, 24 Jul 2018 16:34:59 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5776775D81; Tue, 24 Jul 2018 16:34:59 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CC716217; Tue, 24 Jul 2018 16:34:59 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6OGYwtJ034227; Tue, 24 Jul 2018 16:34:58 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6OGYwY6034223; Tue, 24 Jul 2018 16:34:58 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201807241634.w6OGYwY6034223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Tue, 24 Jul 2018 16:34:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336675 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 336675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 16:34:59 -0000 Author: brd Date: Tue Jul 24 16:34:58 2018 New Revision: 336675 URL: https://svnweb.freebsd.org/changeset/base/336675 Log: Convert bsd.confs.mk to support DIRS. This paves the way for moving config files out of head/etc and into the directories with the src. Approved by: bapt (mentor) Differential Revision: https://reviews.freebsd.org/D16406 Modified: head/share/mk/bsd.confs.mk head/share/mk/bsd.files.mk head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Tue Jul 24 16:31:16 2018 (r336674) +++ head/share/mk/bsd.confs.mk Tue Jul 24 16:34:58 2018 (r336675) @@ -1,25 +1,38 @@ # $FreeBSD$ .if !target(____) -.error bsd.conf.mk cannot be included directly. +. error bsd.conf.mk cannot be included directly. .endif +.if !target(____) +. if target(____) +. error bsd.dirs.mk must be included after bsd.confs.mk. +. endif + +____: + CONFGROUPS?= CONFS -.if !target(buildconfig) -.for group in ${CONFGROUPS} +. if !target(buildconfig) +. for group in ${CONFGROUPS} buildconfig: ${${group}} -.endfor -.endif +. endfor +. endif -.if !defined(_SKIP_BUILD) +. if !defined(_SKIP_BUILD) all: buildconfig -.endif +. endif -.if !target(installconfig) -.for group in ${CONFGROUPS} -.if defined(${group}) && !empty(${group}) +. if !target(installconfig) +. for group in ${CONFGROUPS} +. if defined(${group}) && !empty(${group}) +. if !target(afterinstallconfig) +afterinstallconfig: +. endif +installconfig: realinstallconfig afterinstallconfig +.ORDER: realinstallconfig afterinstallconfig + ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} ${group}MODE?= ${CONFMODE} @@ -27,61 +40,100 @@ ${group}DIR?= ${CONFDIR} STAGE_SETS+= ${group:C,[/*],_,g} STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} -_${group}CONFS= -.for cnf in ${${group}} -.if defined(${group}OWN_${cnf:T}) || defined(${group}GRP_${cnf:T}) || \ - defined(${group}MODE_${cnf:T}) || defined(${group}DIR_${cnf:T}) || \ - defined(${group}NAME_${cnf:T}) || defined(${group}NAME) -${group}OWN_${cnf:T}?= ${${group}OWN} -${group}GRP_${cnf:T}?= ${${group}GRP} -${group}MODE_${cnf:T}?= ${${group}MODE} -${group}DIR_${cnf:T}?= ${${group}DIR} -.if defined(${group}NAME) -${group}NAME_${cnf:T}?= ${${group}NAME} -.else -${group}NAME_${cnf:T}?= ${cnf:T} -.endif +. if defined(NO_ROOT) +. if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*} +. if defined(${${group}PACKAGE}) +${group}TAGS+= package=${${group}PACKAGE:Uruntime} +. else +${group}TAGS+= package=${PACKAGE:Uruntime} +. endif +. endif +${group}TAGS+= config +${group}TAG_ARGS= -T ${${group}TAGS:[*]:S/ /,/g} +. endif + + +. if ${${group}DIR:S/^\///} == ${${group}DIR} +# ${group}DIR specifies a variable that specifies a path +DIRS+= ${${group}DIR} +_${group}DIR= ${${group}DIR} +. else +# ${group}DIR specifies a path +DIRS+= ${group}DIR +_${group}DIR= ${group}DIR +. endif + + +. for cnf in ${${group}} +${group}OWN_${cnf}?= ${${group}OWN} +${group}GRP_${cnf}?= ${${group}GRP} +${group}MODE_${cnf}?= ${${group}MODE} +${group}DIR_${cnf}?= ${${group}DIR} +. if defined(${group}NAME) +${group}NAME_${cnf}?= ${${group}NAME} +. else +${group}NAME_${cnf}?= ${cnf:T} +. endif + + +# 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} +. if ${${group}DIR_${cnf}:S/^\///} == ${${group}DIR_${cnf}} +# DIR specifies a variable that specifies a path +_${group}DIR_${cnf}= ${${group}DIR_${cnf}} +. else +# DIR directly specifies a path +_${group}DIR_${cnf}= ${group}DIR_${cnf} +. endif +${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. +. for d in ${DIRS} +_DIRS+= ${${d}} +. endfor +. if ${DIRS:M${_${group}DIR_${cnf}}} == "" +. if ${_DIRS:M${${_${group}DIR_${cnf}}}} == "" +DIRS+= ${_${group}DIR_${cnf}} +. else +_${group}DIR_${cnf}= ${group}DIR +. endif +. endif + +. if defined(${group}NAME) +${group}NAME_${cnf}?= ${${group}NAME} +. else +${group}NAME_${cnf}?= ${cnf:T} +. endif # defined(${group}NAME) + + STAGE_AS_SETS+= ${cnf:T} STAGE_AS_${cnf:T}= ${${group}NAME_${cnf:T}} # XXX {group}OWN,GRP,MODE STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${group}DIR_${cnf:T}} stage_as.${cnf:T}: ${cnf} -installconfig: _${group}INS_${cnf:T} +realinstallconfig: installdirs-${_${group}DIR_${cnf}} _${group}INS_${cnf:T} _${group}INS_${cnf:T}: ${cnf} - ${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \ - -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ - ${.ALLSRC} \ - ${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}} -.else -_${group}CONFS+= ${cnf} -.endif -.endfor -.if !empty(_${group}CONFS) -stage_files.${group}: ${_${group}CONFS} + ${INSTALL} ${${group}TAG_ARGS} -C -o ${${group}OWN_${cnf}} \ + -g ${${group}GRP_${cnf}} -m ${${group}MODE_${cnf}} \ + ${.ALLSRC} ${${group}PREFIX_${cnf}}/${${group}NAME_${cnf}} +. endfor # for cnf in ${${group}} -installconfig: _${group}INS -_${group}INS: ${_${group}CONFS} -.if defined(${group}NAME) - ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ - ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME} -.else - ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ - ${.ALLSRC} ${DESTDIR}${${group}DIR}/ -.endif -.endif -.endif # defined(${group}) && !empty(${group}) -.endfor +. endif # defined(${group}) && !empty(${group}) +. endfor .endif # !target(installconfig) .if ${MK_STAGING} != "no" -.if !empty(STAGE_SETS) +. if !empty(STAGE_SETS) buildconfig: stage_files -.if !empty(STAGE_AS_SETS) +. if !empty(STAGE_AS_SETS) buildconfig: stage_as +. endif +. endif .endif -.endif -.endif +.endif # !target(____) Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Tue Jul 24 16:31:16 2018 (r336674) +++ head/share/mk/bsd.files.mk Tue Jul 24 16:34:58 2018 (r336675) @@ -121,4 +121,6 @@ buildfiles: stage_as .endif .endif +.include + .endif # !target(____) Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Jul 24 16:31:16 2018 (r336674) +++ head/share/mk/bsd.lib.mk Tue Jul 24 16:34:58 2018 (r336675) @@ -432,9 +432,9 @@ _libinstall: .if !defined(LIBRARIES_ONLY) .include +.include .include .include -.include .endif LINKOWN?= ${LIBOWN}