Update dirdeps.mk to latest
Also add meta2deps.{py,sh} to FILES so they get installed/staged
Reviewed by: stevek
This commit is contained in:
@@ -67,6 +67,8 @@ FILES= \
|
|||||||
meta.stage.mk \
|
meta.stage.mk \
|
||||||
meta.subdir.mk \
|
meta.subdir.mk \
|
||||||
meta.sys.mk \
|
meta.sys.mk \
|
||||||
|
meta2deps.py \
|
||||||
|
meta2deps.sh \
|
||||||
${SRCTOP}/contrib/bmake/mk/posix.mk \
|
${SRCTOP}/contrib/bmake/mk/posix.mk \
|
||||||
stage-install.sh \
|
stage-install.sh \
|
||||||
sys.mk \
|
sys.mk \
|
||||||
|
|||||||
+38
-13
@@ -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
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
#
|
#
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
# DIRDEPS_EXPORT_VARS (DEP_EXPORT_VARS)
|
# DIRDEPS_EXPORT_VARS (DEP_EXPORT_VARS)
|
||||||
# It is discouraged, but sometimes necessary for a
|
# It is discouraged, but sometimes necessary for a
|
||||||
# Makefile.depend file to influence the environment.
|
# 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
|
# tricky so a Makefile.depend file can set DIRDEPS_EXPORT_VARS
|
||||||
# and dirdeps.mk will do the deed:
|
# and dirdeps.mk will do the deed:
|
||||||
#
|
#
|
||||||
@@ -581,6 +581,7 @@ BUILD_DIRDEPS_MAKEFILE ?= -f dirdeps.mk
|
|||||||
|
|
||||||
# these should generally do
|
# these should generally do
|
||||||
BUILD_DIRDEPS_MAKEFILE ?=
|
BUILD_DIRDEPS_MAKEFILE ?=
|
||||||
|
BUILD_DIRDEPS_OVERRIDES ?=
|
||||||
BUILD_DIRDEPS_TARGETS ?= ${.TARGETS}
|
BUILD_DIRDEPS_TARGETS ?= ${.TARGETS}
|
||||||
|
|
||||||
.if ${DIRDEPS_CACHE} != ${STATIC_DIRDEPS_CACHE:Uno} && ${DIRDEPS_CACHE:M${SRCTOP}/*} == ""
|
.if ${DIRDEPS_CACHE} != ${STATIC_DIRDEPS_CACHE:Uno} && ${DIRDEPS_CACHE:M${SRCTOP}/*} == ""
|
||||||
@@ -600,7 +601,9 @@ ${DIRDEPS_CACHE}: .META .NOMETA_CMP
|
|||||||
TARGET_SPEC=${TARGET_SPEC} \
|
TARGET_SPEC=${TARGET_SPEC} \
|
||||||
MAKEFLAGS= ${DIRDEP_CACHE_MAKE:U${.MAKE}} -C ${_CURDIR} \
|
MAKEFLAGS= ${DIRDEP_CACHE_MAKE:U${.MAKE}} -C ${_CURDIR} \
|
||||||
${BUILD_DIRDEPS_MAKEFILE} \
|
${BUILD_DIRDEPS_MAKEFILE} \
|
||||||
${BUILD_DIRDEPS_TARGETS} BUILD_DIRDEPS_CACHE=yes \
|
${BUILD_DIRDEPS_TARGETS} \
|
||||||
|
${BUILD_DIRDEPS_OVERRIDES} \
|
||||||
|
BUILD_DIRDEPS_CACHE=yes \
|
||||||
.MAKE.DEPENDFILE=.none \
|
.MAKE.DEPENDFILE=.none \
|
||||||
${"${DEBUG_DIRDEPS:Nno}":?DEBUG_DIRDEPS='${DEBUG_DIRDEPS}':} \
|
${"${DEBUG_DIRDEPS:Nno}":?DEBUG_DIRDEPS='${DEBUG_DIRDEPS}':} \
|
||||||
${.MAKEFLAGS:tW:S,-D ,-D,g:tw:M*WITH*} \
|
${.MAKEFLAGS:tW:S,-D ,-D,g:tw:M*WITH*} \
|
||||||
@@ -692,9 +695,22 @@ DEP_DIRDEPS_FILTER = \
|
|||||||
${DIRDEPS_FILTER.${DEP_TARGET_SPEC}:U} \
|
${DIRDEPS_FILTER.${DEP_TARGET_SPEC}:U} \
|
||||||
${TARGET_SPEC_VARS:@v@${DIRDEPS_FILTER.${DEP_$v}:U}@} \
|
${TARGET_SPEC_VARS:@v@${DIRDEPS_FILTER.${DEP_$v}:U}@} \
|
||||||
${DIRDEPS_FILTER:U}
|
${DIRDEPS_FILTER:U}
|
||||||
|
|
||||||
.if empty(DEP_DIRDEPS_FILTER)
|
.if empty(DEP_DIRDEPS_FILTER)
|
||||||
# something harmless
|
# 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
|
.endif
|
||||||
|
|
||||||
# this is what we start with
|
# this is what we start with
|
||||||
@@ -714,6 +730,7 @@ __qual_depdirs += ${__hostdpadd}
|
|||||||
|
|
||||||
.if ${_debug_reldir}
|
.if ${_debug_reldir}
|
||||||
.info DEP_DIRDEPS_FILTER=${DEP_DIRDEPS_FILTER:ts:}
|
.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 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 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:}}
|
.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
|
# make sure we do not mess with qualifying "host" entries
|
||||||
_build_dirs := ${_build_dirs:M*.host*:${M_dep_qual_fixes.host:ts:}} \
|
_build_dirs := ${_build_dirs:M*.host*:${M_dep_qual_fixes.host:ts:}} \
|
||||||
${_build_dirs:N*.host*:${M_dep_qual_fixes: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}
|
.if ${_debug_reldir}
|
||||||
.info _build_dirs=${_build_dirs:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}}
|
.info _build_dirs=${_build_dirs:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}}
|
||||||
.endif
|
.endif
|
||||||
@@ -743,6 +761,11 @@ _build_dirs := ${_build_dirs:O:u}
|
|||||||
_build_all_dirs += ${_build_dirs} ${_build_xtra_dirs}
|
_build_all_dirs += ${_build_dirs} ${_build_xtra_dirs}
|
||||||
_build_all_dirs := ${_build_all_dirs:O:u}
|
_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,
|
# Normally if doing make -V something,
|
||||||
# we do not want to waste time chasing DIRDEPS
|
# we do not want to waste time chasing DIRDEPS
|
||||||
# but if we want to count the number of Makefile.depend* read, we do.
|
# 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
|
# guard against _new_dirdeps being too big for a single command line
|
||||||
_new_dirdeps := ${_build_all_dirs:@x@${target($x):?:$x}@:S,^${SRCTOP}/,,}
|
_new_dirdeps := ${_build_all_dirs:@x@${target($x):?:$x}@:S,^${SRCTOP}/,,}
|
||||||
_cache_xtra_deps := ${_build_xtra_dirs: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.
|
# Discouraged, but there are always exceptions.
|
||||||
# Handle it here rather than explain how.
|
# 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_xvars := echo; ${DIRDEPS_EXPORT_VARS:@v@echo '$v = ${$v}';@} echo '.export ${DIRDEPS_EXPORT_VARS}'; echo;
|
||||||
_cache_script += ${_cache_xvars}
|
_cache_script += ${_cache_xvars}
|
||||||
.endif
|
.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:}}
|
.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: needs: ${_build_dirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}}
|
||||||
.endif
|
.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
|
# this builds the dependency graph
|
||||||
.for m in ${_machines}
|
.for m in ${_machines}
|
||||||
.if ${BUILD_DIRDEPS_CACHE} == "yes" && !empty(_build_dirs)
|
.if ${BUILD_DIRDEPS_CACHE} == "yes" && !empty(_build_dirs)
|
||||||
@@ -832,6 +848,15 @@ ${_this_dir}.$m: ${_build_dirs:M*.$m:N${_this_dir}.$m}
|
|||||||
|
|
||||||
.endif
|
.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.
|
# Now find more dependencies - and recurse.
|
||||||
.for d in ${_build_all_dirs}
|
.for d in ${_build_all_dirs}
|
||||||
.if !target(_dirdeps_checked.$d)
|
.if !target(_dirdeps_checked.$d)
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
.-include <${.PARSEFILE:S/local/site/}>
|
.-include <${.PARSEFILE:S/local/site/}>
|
||||||
|
|
||||||
|
DIRDEPS_TARGETS_DIRS ?= targets targets/pseudo targets/packages
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# SPDX-License-Identifier: BSD-2-Clause
|
# 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
|
# @(#) 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.
|
# dirdeps.mk will compute some interesting combinations.
|
||||||
.undef ALL_MACHINES
|
.undef ALL_MACHINES
|
||||||
|
|
||||||
DEP_RELDIR = ${RELDIR}
|
|
||||||
.include <dirdeps.mk>
|
.include <dirdeps.mk>
|
||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
|
|||||||
Reference in New Issue
Block a user