From nobody Mon Jul 29 19:49:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXppJ5jjvz5RsDv; Mon, 29 Jul 2024 19:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXppJ59ldz4dyx; Mon, 29 Jul 2024 19:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722282552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uUzZ6I7mhruGv4qAWic+gZFdntrfvu9o8jCosmmTwE8=; b=IYUrEJ6GZJL4TUkkyT3u+2kZ9nQe1WHjtH77rBHl8JHuIe/yGCi01UCA+mqvJYafThP82S 9yN5y4UI0bS00Qa8CjwlvXaWgLTp3nB70Dyl2Fe5r52p08dnmhSoQpKEK15C01E1lXYOFo 2GOOYV1fprWQEghvu0D+nNkP7AV9cqmWmD7jIC7zPOHZh/SHcWEBs5ClUplCcYxFM1nlKt QZ0xEDQ5UH5c0J1Eq7MaEQb370bsGr5WH1OJGg51R/BVlZ7s8Sz95rlLeVnn4nMZRdG4/Y IMzJbmrIwZ+5sajBwkfNk2bOZzo68EejmE4L98hz0ODP7y5JcwqLBxihdqO7OA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722282552; a=rsa-sha256; cv=none; b=r1LuzmnMtMGD3AMltVR1eHJFTE6j25WTDEG6Rmttux6DAGtQTVV6q0akLN+d5wZhdq7T9H CISSDpaeE2qibmb+Ix62nb9UpDm5cUbWzFsrtJUI5oYHwoyp80aJiH1a2DMkQiuK6/XjTW +N77IV3gIDW6xL72EYpHx6cS4aMPugi68cIYbXL7qplQsy01uMjP9hdbEzfHsApzgTqPPH TvguQaJIryyH9w9HdkwHpOTiekeHkaMfGKOi9g+1YMhDwmQoUWL5XHySkfgKc1EAgp5TlF 3ZJJ/tWxOFG0jJLSYiQtLsm2zn/jQMWA/Q4HogRxXrCdER7/FuLOY99aRN0tew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722282552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uUzZ6I7mhruGv4qAWic+gZFdntrfvu9o8jCosmmTwE8=; b=Yz0Kyws3N0IBpyJGH9fFn9Eiej1hxgTgXUE2vjruLXHeNFi0Nd4a25G9lHahETo8Gss8Sz CQdhQrXCQIC2CZEsfUMfidcnzTv2dXmP3KKCjTKvdkk1DyVIGT9LG3M4eOwtOxe7Nnlb0q XdUp7mmFuet2ReN9LpIu4bGVuWF5xiLj4RIN+bvBvJHo5P//Vj7KiMI3LwH6VjcWC/0fA+ 6NvEnIm9+rqgEy4CZmPB0s0BulNHVFrwol+O6+cqgrQXDEtszs6cxakvCBLp1MYeaL1o9b MUN2m9oPJLAprSycwhBT3u4/lulgYPvzyALeeCvVNTATQ3oPpFFNQjXUvDnYcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXppJ4mr7znfx; Mon, 29 Jul 2024 19:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46TJnCdQ028064; Mon, 29 Jul 2024 19:49:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TJnCGG028061; Mon, 29 Jul 2024 19:49:12 GMT (envelope-from git) Date: Mon, 29 Jul 2024 19:49:12 GMT Message-Id: <202407291949.46TJnCGG028061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: a2b67d4a6e36 - main - Update dirdeps.mk to latest List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2b67d4a6e364586ae7180cc4696609e8960f955 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a2b67d4a6e364586ae7180cc4696609e8960f955 commit a2b67d4a6e364586ae7180cc4696609e8960f955 Author: Simon J. Gerraty AuthorDate: 2024-07-29 19:48:38 +0000 Commit: Simon J. Gerraty CommitDate: 2024-07-29 19:48:56 +0000 Update dirdeps.mk to latest Also add meta2deps.{py,sh} to FILES so they get installed/staged Reviewed by: stevek --- share/mk/Makefile | 2 ++ share/mk/dirdeps.mk | 51 +++++++++++++++++++++++++++++---------- share/mk/local.dirdeps-targets.mk | 2 ++ share/mk/meta.subdir.mk | 3 +-- 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/share/mk/Makefile b/share/mk/Makefile index 85b39a9c72ea..737b11d5a0f2 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -67,6 +67,8 @@ FILES= \ meta.stage.mk \ meta.subdir.mk \ meta.sys.mk \ + meta2deps.py \ + meta2deps.sh \ ${SRCTOP}/contrib/bmake/mk/posix.mk \ stage-install.sh \ sys.mk \ diff --git a/share/mk/dirdeps.mk b/share/mk/dirdeps.mk index b3b34145e8e9..2a9d2ac92102 100644 --- a/share/mk/dirdeps.mk +++ b/share/mk/dirdeps.mk @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.166 2024/01/05 23:16:34 sjg Exp $ +# $Id: dirdeps.mk,v 1.170 2024/06/24 02:21:00 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # @@ -139,7 +139,7 @@ # DIRDEPS_EXPORT_VARS (DEP_EXPORT_VARS) # It is discouraged, but sometimes necessary for a # Makefile.depend file to influence the environment. -# Doing this is correctly (especially if using DIRDEPS_CACHE) is +# Doing this correctly (especially if using DIRDEPS_CACHE) is # tricky so a Makefile.depend file can set DIRDEPS_EXPORT_VARS # and dirdeps.mk will do the deed: # @@ -581,6 +581,7 @@ BUILD_DIRDEPS_MAKEFILE ?= -f dirdeps.mk # these should generally do BUILD_DIRDEPS_MAKEFILE ?= +BUILD_DIRDEPS_OVERRIDES ?= BUILD_DIRDEPS_TARGETS ?= ${.TARGETS} .if ${DIRDEPS_CACHE} != ${STATIC_DIRDEPS_CACHE:Uno} && ${DIRDEPS_CACHE:M${SRCTOP}/*} == "" @@ -600,7 +601,9 @@ ${DIRDEPS_CACHE}: .META .NOMETA_CMP TARGET_SPEC=${TARGET_SPEC} \ MAKEFLAGS= ${DIRDEP_CACHE_MAKE:U${.MAKE}} -C ${_CURDIR} \ ${BUILD_DIRDEPS_MAKEFILE} \ - ${BUILD_DIRDEPS_TARGETS} BUILD_DIRDEPS_CACHE=yes \ + ${BUILD_DIRDEPS_TARGETS} \ + ${BUILD_DIRDEPS_OVERRIDES} \ + BUILD_DIRDEPS_CACHE=yes \ .MAKE.DEPENDFILE=.none \ ${"${DEBUG_DIRDEPS:Nno}":?DEBUG_DIRDEPS='${DEBUG_DIRDEPS}':} \ ${.MAKEFLAGS:tW:S,-D ,-D,g:tw:M*WITH*} \ @@ -692,9 +695,22 @@ DEP_DIRDEPS_FILTER = \ ${DIRDEPS_FILTER.${DEP_TARGET_SPEC}:U} \ ${TARGET_SPEC_VARS:@v@${DIRDEPS_FILTER.${DEP_$v}:U}@} \ ${DIRDEPS_FILTER:U} + .if empty(DEP_DIRDEPS_FILTER) # something harmless -DEP_DIRDEPS_FILTER = U +DEP_DIRDEPS_FILTER = u +.endif + +# this is applied after we have computed build dirs +# so everything is fully qualified and starts with ${SRCTOP}/ +DEP_DIRDEPS_BUILD_DIR_FILTER = \ + ${DIRDEPS_BUILD_DIR_FILTER.${DEP_TARGET_SPEC}:U} \ + ${TARGET_SPEC_VARS:@v@${DIRDEPS_BUILD_DIR_FILTER.${DEP_$v}:U}@} \ + ${DIRDEPS_BUILD_DIR_FILTER:U} + +.if empty(DEP_DIRDEPS_BUILD_DIR_FILTER) +# something harmless +DEP_DIRDEPS_BUILD_DIR_FILTER = u .endif # this is what we start with @@ -714,6 +730,7 @@ __qual_depdirs += ${__hostdpadd} .if ${_debug_reldir} .info DEP_DIRDEPS_FILTER=${DEP_DIRDEPS_FILTER:ts:} +.info DEP_DIRDEPS_BUILD_DIR_FILTER=${DEP_DIRDEPS_BUILD_DIR_FILTER:ts:} .info depdirs=${__depdirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} .info qualified=${__qual_depdirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} .info unqualified=${__unqual_depdirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} @@ -733,7 +750,8 @@ _build_dirs += \ # make sure we do not mess with qualifying "host" entries _build_dirs := ${_build_dirs:M*.host*:${M_dep_qual_fixes.host:ts:}} \ ${_build_dirs:N*.host*:${M_dep_qual_fixes:ts:}} -_build_dirs := ${_build_dirs:O:u} +# some filters can only be applied now +_build_dirs := ${_build_dirs:${DEP_DIRDEPS_BUILD_DIR_FILTER:ts:}:O:u} .if ${_debug_reldir} .info _build_dirs=${_build_dirs:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} .endif @@ -743,6 +761,11 @@ _build_dirs := ${_build_dirs:O:u} _build_all_dirs += ${_build_dirs} ${_build_xtra_dirs} _build_all_dirs := ${_build_all_dirs:O:u} +# we prefer DIRDEPS_EXPORT_VARS +.if empty(DIRDEPS_EXPORT_VARS) && !empty(DEP_EXPORT_VARS) +DIRDEPS_EXPORT_VARS = ${DEP_EXPORT_VARS} +.endif + # Normally if doing make -V something, # we do not want to waste time chasing DIRDEPS # but if we want to count the number of Makefile.depend* read, we do. @@ -754,10 +777,9 @@ _cache_script = echo '\# ${DEP_RELDIR}.${DEP_TARGET_SPEC}'; # guard against _new_dirdeps being too big for a single command line _new_dirdeps := ${_build_all_dirs:@x@${target($x):?:$x}@:S,^${SRCTOP}/,,} _cache_xtra_deps := ${_build_xtra_dirs:S,^${SRCTOP}/,,} -.if !empty(DIRDEPS_EXPORT_VARS) || !empty(DEP_EXPORT_VARS) +.if !empty(DIRDEPS_EXPORT_VARS) # Discouraged, but there are always exceptions. # Handle it here rather than explain how. -DIRDEPS_EXPORT_VARS ?= ${DEP_EXPORT_VARS} _cache_xvars := echo; ${DIRDEPS_EXPORT_VARS:@v@echo '$v = ${$v}';@} echo '.export ${DIRDEPS_EXPORT_VARS}'; echo; _cache_script += ${_cache_xvars} .endif @@ -771,12 +793,6 @@ ${_build_all_dirs}: _DIRDEP_USE .info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: needs: ${_build_dirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} .endif -.if !empty(DIRDEPS_EXPORT_VARS) || !empty(DEP_EXPORT_VARS) -.export ${DIRDEPS_EXPORT_VARS} ${DEP_EXPORT_VARS} -DIRDEPS_EXPORT_VARS = -DEP_EXPORT_VARS = -.endif - # this builds the dependency graph .for m in ${_machines} .if ${BUILD_DIRDEPS_CACHE} == "yes" && !empty(_build_dirs) @@ -832,6 +848,15 @@ ${_this_dir}.$m: ${_build_dirs:M*.$m:N${_this_dir}.$m} .endif +.if !empty(DIRDEPS_EXPORT_VARS) +.if ${BUILD_DIRDEPS_CACHE} == "no" +.export ${DIRDEPS_EXPORT_VARS} +.endif +# Reset these, we are done with them for this iteration. +DIRDEPS_EXPORT_VARS = +DEP_EXPORT_VARS = +.endif + # Now find more dependencies - and recurse. .for d in ${_build_all_dirs} .if !target(_dirdeps_checked.$d) diff --git a/share/mk/local.dirdeps-targets.mk b/share/mk/local.dirdeps-targets.mk index f07708c2c551..00346cddeeee 100644 --- a/share/mk/local.dirdeps-targets.mk +++ b/share/mk/local.dirdeps-targets.mk @@ -1 +1,3 @@ .-include <${.PARSEFILE:S/local/site/}> + +DIRDEPS_TARGETS_DIRS ?= targets targets/pseudo targets/packages diff --git a/share/mk/meta.subdir.mk b/share/mk/meta.subdir.mk index e2ece24515a4..aee8a1a9a39b 100644 --- a/share/mk/meta.subdir.mk +++ b/share/mk/meta.subdir.mk @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # -# $Id: meta.subdir.mk,v 1.14 2024/02/17 17:26:57 sjg Exp $ +# $Id: meta.subdir.mk,v 1.15 2024/04/19 15:10:22 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -70,7 +70,6 @@ DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIRDEPS_FILTER:Uu}} # dirdeps.mk will compute some interesting combinations. .undef ALL_MACHINES -DEP_RELDIR = ${RELDIR} .include .endif .endif