Update dirdeps.mk et al
bmake-20240309 includes updates to dirdeps and meta mode makefiles
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
# $Id: dirdeps-options.mk,v 1.21 2022/09/06 22:18:45 sjg Exp $
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
#
|
||||||
|
# $Id: dirdeps-options.mk,v 1.22 2024/02/17 17:26:57 sjg Exp $
|
||||||
#
|
#
|
||||||
# @(#) Copyright (c) 2018-2022, Simon J. Gerraty
|
# @(#) Copyright (c) 2018-2022, Simon J. Gerraty
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
#
|
||||||
# RCSid:
|
# RCSid:
|
||||||
# $Id: dirdeps-targets.mk,v 1.25 2023/05/11 05:07:28 sjg Exp $
|
# $Id: dirdeps-targets.mk,v 1.27 2024/02/25 19:12:13 sjg Exp $
|
||||||
#
|
#
|
||||||
# @(#) Copyright (c) 2019-2020 Simon J. Gerraty
|
# @(#) Copyright (c) 2019-2020 Simon J. Gerraty
|
||||||
#
|
#
|
||||||
@@ -40,6 +42,9 @@
|
|||||||
# pickup customizations
|
# pickup customizations
|
||||||
.-include <local.dirdeps-targets.mk>
|
.-include <local.dirdeps-targets.mk>
|
||||||
|
|
||||||
|
# this is what we are here for
|
||||||
|
.MAIN: dirdeps
|
||||||
|
|
||||||
# for DIRDEPS_BUILD this is how we prime the pump
|
# for DIRDEPS_BUILD this is how we prime the pump
|
||||||
# include . to allow any directory to work as a target
|
# include . to allow any directory to work as a target
|
||||||
DIRDEPS_TARGETS_DIRS ?= targets targets/pseudo
|
DIRDEPS_TARGETS_DIRS ?= targets targets/pseudo
|
||||||
|
|||||||
+25
-12
@@ -1,4 +1,4 @@
|
|||||||
# $Id: dirdeps.mk,v 1.162 2023/05/15 17:37:46 sjg Exp $
|
# $Id: dirdeps.mk,v 1.166 2024/01/05 23:16:34 sjg Exp $
|
||||||
|
|
||||||
# SPDX-License-Identifier: BSD-2-Clause
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
#
|
#
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
# if any test fails, but without the risk of introducing
|
# if any test fails, but without the risk of introducing
|
||||||
# circular dependencies.
|
# circular dependencies.
|
||||||
|
|
||||||
now_utc ?= ${%s:L:gmtime}
|
now_utc ?= ${%s:L:localtime}
|
||||||
.if !defined(start_utc)
|
.if !defined(start_utc)
|
||||||
start_utc := ${now_utc}
|
start_utc := ${now_utc}
|
||||||
.endif
|
.endif
|
||||||
@@ -415,6 +415,8 @@ DIRDEPS_FILTER += M${_DEP_RELDIR}
|
|||||||
# this is what we run below
|
# this is what we run below
|
||||||
DIRDEP_MAKE ?= ${.MAKE}
|
DIRDEP_MAKE ?= ${.MAKE}
|
||||||
DIRDEP_DIR ?= ${.TARGET:R}
|
DIRDEP_DIR ?= ${.TARGET:R}
|
||||||
|
# we normally want the default target
|
||||||
|
DIRDEP_TARGETS ?=
|
||||||
|
|
||||||
# if you want us to report load averages during build
|
# if you want us to report load averages during build
|
||||||
# DIRDEP_USE_PRELUDE += ${DIRDEP_LOADAVG_REPORT};
|
# DIRDEP_USE_PRELUDE += ${DIRDEP_LOADAVG_REPORT};
|
||||||
@@ -442,7 +444,7 @@ _DIRDEP_USE: .USE .MAKE
|
|||||||
MACHINE_ARCH= NO_SUBDIR=1 ${DIRDEP_USE_ENV} \
|
MACHINE_ARCH= NO_SUBDIR=1 ${DIRDEP_USE_ENV} \
|
||||||
TARGET_SPEC=${.TARGET:E} \
|
TARGET_SPEC=${.TARGET:E} \
|
||||||
MACHINE=${.TARGET:E} \
|
MACHINE=${.TARGET:E} \
|
||||||
${DIRDEP_MAKE} -C ${DIRDEP_DIR} || exit 1; \
|
${DIRDEP_MAKE} -C ${DIRDEP_DIR} ${DIRDEP_TARGETS} || exit 1; \
|
||||||
break; \
|
break; \
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -680,7 +682,7 @@ _build_dirs += ${_machines:@m@${_CURDIR}.$m@}
|
|||||||
|
|
||||||
.if ${_debug_reldir}
|
.if ${_debug_reldir}
|
||||||
.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: nDIRDEPS=${DIRDEPS:[#]}
|
.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: nDIRDEPS=${DIRDEPS:[#]}
|
||||||
.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: DIRDEPS='${DIRDEPS}'
|
.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: DIRDEPS=${DIRDEPS:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}}
|
||||||
.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: _machines='${_machines}'
|
.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: _machines='${_machines}'
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
@@ -712,9 +714,9 @@ __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 depdirs=${__depdirs:S,^${SRCTOP}/,,}
|
.info depdirs=${__depdirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}}
|
||||||
.info qualified=${__qual_depdirs:S,^${SRCTOP}/,,}
|
.info qualified=${__qual_depdirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}}
|
||||||
.info unqualified=${__unqual_depdirs:S,^${SRCTOP}/,,}
|
.info unqualified=${__unqual_depdirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}}
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
# _build_dirs is what we will feed to _DIRDEP_USE
|
# _build_dirs is what we will feed to _DIRDEP_USE
|
||||||
@@ -726,14 +728,14 @@ _build_dirs += \
|
|||||||
|
|
||||||
# qualify everything now
|
# qualify everything now
|
||||||
.if ${_debug_reldir}
|
.if ${_debug_reldir}
|
||||||
.info _build_dirs=${_build_dirs}
|
.info _build_dirs=${_build_dirs:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}}
|
||||||
.endif
|
.endif
|
||||||
# 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}
|
_build_dirs := ${_build_dirs:O:u}
|
||||||
.if ${_debug_reldir}
|
.if ${_debug_reldir}
|
||||||
.info _build_dirs=${_build_dirs}
|
.info _build_dirs=${_build_dirs:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}}
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.endif # empty DIRDEPS
|
.endif # empty DIRDEPS
|
||||||
@@ -752,7 +754,6 @@ _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}/,,}
|
||||||
.export _cache_xtra_deps _new_dirdeps
|
|
||||||
.if !empty(DIRDEPS_EXPORT_VARS) || !empty(DEP_EXPORT_VARS)
|
.if !empty(DIRDEPS_EXPORT_VARS) || !empty(DEP_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.
|
||||||
@@ -767,7 +768,7 @@ dirdeps: ${_build_all_dirs}
|
|||||||
${_build_all_dirs}: _DIRDEP_USE
|
${_build_all_dirs}: _DIRDEP_USE
|
||||||
|
|
||||||
.if ${_debug_reldir}
|
.if ${_debug_reldir}
|
||||||
.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: needs: ${_build_dirs:S,^${SRCTOP}/,,}
|
.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)
|
.if !empty(DIRDEPS_EXPORT_VARS) || !empty(DEP_EXPORT_VARS)
|
||||||
@@ -802,15 +803,27 @@ ${_this_dir}.$m: ${_build_dirs:M*.$q}
|
|||||||
.if ${BUILD_DIRDEPS_CACHE} == "yes"
|
.if ${BUILD_DIRDEPS_CACHE} == "yes"
|
||||||
.if !empty(_build_dirs)
|
.if !empty(_build_dirs)
|
||||||
_cache_deps += ${_build_dirs:M*.$m:N${_this_dir}.$m:S,^${SRCTOP}/,,}
|
_cache_deps += ${_build_dirs:M*.$m:N${_this_dir}.$m:S,^${SRCTOP}/,,}
|
||||||
|
# anything in _{build,env}_xtra_dirs is hooked to dirdeps: only
|
||||||
|
.if ${MAKE_VERSION} < 20240105
|
||||||
.if !empty(_cache_deps)
|
.if !empty(_cache_deps)
|
||||||
.export _cache_deps
|
.export _cache_deps
|
||||||
_cache_script += for x in $$_cache_deps; do echo " _{SRCTOP}/$$x \\"; done;
|
_cache_script += for x in $$_cache_deps; do echo " _{SRCTOP}/$$x \\"; done;
|
||||||
.endif
|
.endif
|
||||||
# anything in _{build,env}_xtra_dirs is hooked to dirdeps: only
|
.export _cache_xtra_deps _new_dirdeps
|
||||||
x!= echo; { echo; ${_cache_script} echo; echo '${_this_dir}.$m: $${DIRDEPS.${_this_dir}.$m}'; \
|
x!= echo; { echo; ${_cache_script} echo; echo '${_this_dir}.$m: $${DIRDEPS.${_this_dir}.$m}'; \
|
||||||
echo; echo 'dirdeps: ${_this_dir}.$m \'; \
|
echo; echo 'dirdeps: ${_this_dir}.$m \'; \
|
||||||
for x in $$_cache_xtra_deps; do echo " _{SRCTOP}/$$x \\"; done; \
|
for x in $$_cache_xtra_deps; do echo " _{SRCTOP}/$$x \\"; done; \
|
||||||
echo; for x in $$_new_dirdeps; do echo "_{SRCTOP}/$$x: _DIRDEP_USE"; done; } >&3
|
echo; for x in $$_new_dirdeps; do echo "_{SRCTOP}/$$x: _DIRDEP_USE"; done; } >&3
|
||||||
|
.else
|
||||||
|
# we do not have the same limits on command lines
|
||||||
|
.if !empty(_cache_deps)
|
||||||
|
_cache_script += for x in ${_cache_deps}; do echo " _{SRCTOP}/$$x \\"; done;
|
||||||
|
.endif
|
||||||
|
x!= echo; { echo; ${_cache_script} echo; echo '${_this_dir}.$m: $${DIRDEPS.${_this_dir}.$m}'; \
|
||||||
|
echo; echo 'dirdeps: ${_this_dir}.$m \'; \
|
||||||
|
for x in ${_cache_xtra_deps}; do echo " _{SRCTOP}/$$x \\"; done; \
|
||||||
|
echo; for x in ${_new_dirdeps}; do echo "_{SRCTOP}/$$x: _DIRDEP_USE"; done; } >&3
|
||||||
|
.endif
|
||||||
.endif
|
.endif
|
||||||
.else
|
.else
|
||||||
${_this_dir}.$m: ${_build_dirs:M*.$m:N${_this_dir}.$m}
|
${_this_dir}.$m: ${_build_dirs:M*.$m:N${_this_dir}.$m}
|
||||||
|
|||||||
@@ -7,10 +7,6 @@ UPDATE_DEPENDFILE= no
|
|||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
NOSSPPICO?= .nossppico
|
|
||||||
PIEO?= .pieo
|
|
||||||
OBJ_EXTENSIONS+= ${NOSSPPICO} ${PIEO}
|
|
||||||
|
|
||||||
CLEANFILES+= .depend
|
CLEANFILES+= .depend
|
||||||
|
|
||||||
# handy for debugging
|
# handy for debugging
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# $Id: meta.autodep.mk,v 1.59 2023/08/19 17:35:32 sjg Exp $
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
#
|
||||||
|
# $Id: meta.autodep.mk,v 1.62 2024/02/17 17:26:57 sjg Exp $
|
||||||
|
|
||||||
#
|
#
|
||||||
# @(#) Copyright (c) 2010, Simon J. Gerraty
|
# @(#) Copyright (c) 2010, Simon J. Gerraty
|
||||||
@@ -24,16 +26,16 @@ PICO?= .pico
|
|||||||
|
|
||||||
.if defined(SRCS)
|
.if defined(SRCS)
|
||||||
.if ${MAKE_VERSION:U0} >= 20211212
|
.if ${MAKE_VERSION:U0} >= 20211212
|
||||||
OBJ_EXTENSIONS += ${.SUFFIXES:M*o}
|
OBJ_SUFFIXES += ${.SUFFIXES:M*o}
|
||||||
.else
|
.else
|
||||||
# it would be nice to be able to query .SUFFIXES
|
# it would be nice to be able to query .SUFFIXES
|
||||||
OBJ_EXTENSIONS += .o .po .lo ${PICO}
|
OBJ_SUFFIXES += .o .po .lo ${PICO}
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
# explicit dependencies help short-circuit .SUFFIX searches
|
# explicit dependencies help short-circuit .SUFFIX searches
|
||||||
SRCS_DEP_FILTER+= N*.[hly]
|
SRCS_DEP_FILTER+= N*.[hly]
|
||||||
.for s in ${SRCS:${SRCS_DEP_FILTER:O:u:ts:}}
|
.for s in ${SRCS:${SRCS_DEP_FILTER:O:u:ts:}}
|
||||||
.for e in ${OBJ_EXTENSIONS:O:u}
|
.for e in ${OBJ_SUFFIXES:O:u}
|
||||||
.if !target(${s:T:R}$e)
|
.if !target(${s:T:R}$e)
|
||||||
${s:T:R}$e: $s
|
${s:T:R}$e: $s
|
||||||
.endif
|
.endif
|
||||||
@@ -190,7 +192,7 @@ DEPEND_SUFFIXES += .c .h .cpp .hpp .cxx .hxx .cc .hh
|
|||||||
@case "${.MAKE.META.FILES:T:M*.po.*}" in \
|
@case "${.MAKE.META.FILES:T:M*.po.*}" in \
|
||||||
*.po.*) mv $@.${.MAKE.PID} $@;; \
|
*.po.*) mv $@.${.MAKE.PID} $@;; \
|
||||||
*) { cat $@.${.MAKE.PID}; \
|
*) { cat $@.${.MAKE.PID}; \
|
||||||
sed ${OBJ_EXTENSIONS:N.o:N.po:@o@-e 's,\$o:,.o:,'@} \
|
sed ${OBJ_SUFFIXES:N.o:N.po:@o@-e 's,\$o:,.o:,'@} \
|
||||||
-e 's,\.o:,.po:,' $@.${.MAKE.PID}; } | sort -u > $@; \
|
-e 's,\.o:,.po:,' $@.${.MAKE.PID}; } | sort -u > $@; \
|
||||||
rm -f $@.${.MAKE.PID};; \
|
rm -f $@.${.MAKE.PID};; \
|
||||||
esac
|
esac
|
||||||
@@ -305,7 +307,7 @@ ${_DEPENDFILE}: .PRECIOUS
|
|||||||
CLEANFILES += *.meta filemon.* *.db
|
CLEANFILES += *.meta filemon.* *.db
|
||||||
|
|
||||||
# these make it easy to gather some stats
|
# these make it easy to gather some stats
|
||||||
now_utc = ${%s:L:localtime}
|
now_utc ?= ${%s:L:localtime}
|
||||||
start_utc := ${now_utc}
|
start_utc := ${now_utc}
|
||||||
|
|
||||||
meta_stats= meta=${empty(.MAKE.META.FILES):?0:${.MAKE.META.FILES:[#]}} \
|
meta_stats= meta=${empty(.MAKE.META.FILES):?0:${.MAKE.META.FILES:[#]}} \
|
||||||
@@ -331,4 +333,6 @@ _reldir_failed: .NOMETA
|
|||||||
.ERROR: _reldir_failed
|
.ERROR: _reldir_failed
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
.-include <ccm.dep.mk>
|
||||||
|
|
||||||
.endif
|
.endif
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# $Id: meta.stage.mk,v 1.67 2023/04/17 01:22:10 sjg Exp $
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
#
|
||||||
|
# $Id: meta.stage.mk,v 1.69 2024/02/17 17:26:57 sjg Exp $
|
||||||
#
|
#
|
||||||
# @(#) Copyright (c) 2011-2017, Simon J. Gerraty
|
# @(#) Copyright (c) 2011-2017, Simon J. Gerraty
|
||||||
#
|
#
|
||||||
@@ -212,7 +214,7 @@ stage_files.$s: .dirdep
|
|||||||
STAGE_FILES ?= ${.ALLSRC:N.dirdep:Nstage_*}
|
STAGE_FILES ?= ${.ALLSRC:N.dirdep:Nstage_*}
|
||||||
stage_files: .dirdep
|
stage_files: .dirdep
|
||||||
.endif
|
.endif
|
||||||
@${STAGE_FILE_SCRIPT}; StageFiles ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_FILES.$s:O}
|
@${STAGE_FILE_SCRIPT}; StageFiles ${FLAGS.$@:U} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_FILES.$s:O}
|
||||||
@touch $@
|
@touch $@
|
||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# $Id: meta.subdir.mk,v 1.13 2021/01/05 22:24:37 sjg Exp $
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
#
|
||||||
|
# $Id: meta.subdir.mk,v 1.14 2024/02/17 17:26:57 sjg Exp $
|
||||||
|
|
||||||
#
|
#
|
||||||
# @(#) Copyright (c) 2010, Simon J. Gerraty
|
# @(#) Copyright (c) 2010, Simon J. Gerraty
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# $Id: meta.sys.mk,v 1.51 2023/05/11 20:05:32 sjg Exp $
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
#
|
||||||
|
# $Id: meta.sys.mk,v 1.54 2024/03/10 15:53:51 sjg Exp $
|
||||||
|
|
||||||
#
|
#
|
||||||
# @(#) Copyright (c) 2010-2023, Simon J. Gerraty
|
# @(#) Copyright (c) 2010-2023, Simon J. Gerraty
|
||||||
@@ -82,6 +84,7 @@ META2DEPS := ${META2DEPS}
|
|||||||
|
|
||||||
MAKE_PRINT_VAR_ON_ERROR += \
|
MAKE_PRINT_VAR_ON_ERROR += \
|
||||||
.ERROR_TARGET \
|
.ERROR_TARGET \
|
||||||
|
.ERROR_EXIT \
|
||||||
.ERROR_META_FILE \
|
.ERROR_META_FILE \
|
||||||
.MAKE.LEVEL \
|
.MAKE.LEVEL \
|
||||||
MAKEFILE \
|
MAKEFILE \
|
||||||
@@ -98,10 +101,13 @@ SB = ${SRCTOP:H}
|
|||||||
ERROR_LOGDIR ?= ${SB}/error
|
ERROR_LOGDIR ?= ${SB}/error
|
||||||
meta_error_log = ${ERROR_LOGDIR}/meta-${.MAKE.PID}.log
|
meta_error_log = ${ERROR_LOGDIR}/meta-${.MAKE.PID}.log
|
||||||
|
|
||||||
# we are not interested in make telling us a failure happened elsewhere
|
|
||||||
.ERROR: _metaError
|
.ERROR: _metaError
|
||||||
|
# We are interested here in the target(s) that caused the build to fail.
|
||||||
|
# We want to ignore targets that were "aborted" due to failure
|
||||||
|
# elsewhere per the message below or a sub-make may just exit 6.
|
||||||
_metaError: .NOMETA .NOTMAIN
|
_metaError: .NOMETA .NOTMAIN
|
||||||
-@[ "${.ERROR_META_FILE}" ] && { \
|
-@[ ${.ERROR_EXIT:U0} = 6 ] && exit 0; \
|
||||||
|
[ "${.ERROR_META_FILE}" ] && { \
|
||||||
grep -q 'failure has been detected in another branch' ${.ERROR_META_FILE} && exit 0; \
|
grep -q 'failure has been detected in another branch' ${.ERROR_META_FILE} && exit 0; \
|
||||||
mkdir -p ${meta_error_log:H}; \
|
mkdir -p ${meta_error_log:H}; \
|
||||||
cp ${.ERROR_META_FILE} ${meta_error_log}; \
|
cp ${.ERROR_META_FILE} ${meta_error_log}; \
|
||||||
|
|||||||
+11
-4
@@ -36,8 +36,10 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
|
||||||
RCSid:
|
RCSid:
|
||||||
$Id: meta2deps.py,v 1.45 2023/01/18 01:35:24 sjg Exp $
|
$Id: meta2deps.py,v 1.47 2024/02/17 17:26:57 sjg Exp $
|
||||||
|
|
||||||
Copyright (c) 2011-2020, Simon J. Gerraty
|
Copyright (c) 2011-2020, Simon J. Gerraty
|
||||||
Copyright (c) 2011-2017, Juniper Networks, Inc.
|
Copyright (c) 2011-2017, Juniper Networks, Inc.
|
||||||
@@ -74,8 +76,10 @@
|
|||||||
def resolve(path, cwd, last_dir=None, debug=0, debug_out=sys.stderr):
|
def resolve(path, cwd, last_dir=None, debug=0, debug_out=sys.stderr):
|
||||||
"""
|
"""
|
||||||
Return an absolute path, resolving via cwd or last_dir if needed.
|
Return an absolute path, resolving via cwd or last_dir if needed.
|
||||||
|
|
||||||
|
Cleanup any leading ``./`` and trailing ``/.``
|
||||||
"""
|
"""
|
||||||
if path.endswith('/.'):
|
while path.endswith('/.'):
|
||||||
path = path[0:-2]
|
path = path[0:-2]
|
||||||
if len(path) > 0 and path[0] == '/':
|
if len(path) > 0 and path[0] == '/':
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
@@ -86,7 +90,9 @@ def resolve(path, cwd, last_dir=None, debug=0, debug_out=sys.stderr):
|
|||||||
if path == '.':
|
if path == '.':
|
||||||
return cwd
|
return cwd
|
||||||
if path.startswith('./'):
|
if path.startswith('./'):
|
||||||
return cwd + path[1:]
|
while path.startswith('./'):
|
||||||
|
path = path[1:]
|
||||||
|
return cwd + path
|
||||||
if last_dir == cwd:
|
if last_dir == cwd:
|
||||||
last_dir = None
|
last_dir = None
|
||||||
for d in [last_dir, cwd]:
|
for d in [last_dir, cwd]:
|
||||||
@@ -144,6 +150,7 @@ def abspath(path, cwd, last_dir=None, debug=0, debug_out=sys.stderr):
|
|||||||
return None
|
return None
|
||||||
if (path.find('/') < 0 or
|
if (path.find('/') < 0 or
|
||||||
path.find('./') > 0 or
|
path.find('./') > 0 or
|
||||||
|
path.find('/../') > 0 or
|
||||||
path.endswith('/..')):
|
path.endswith('/..')):
|
||||||
path = cleanpath(path)
|
path = cleanpath(path)
|
||||||
return path
|
return path
|
||||||
@@ -197,7 +204,7 @@ class MetaFile:
|
|||||||
|
|
||||||
def __init__(self, name, conf={}):
|
def __init__(self, name, conf={}):
|
||||||
"""if name is set we will parse it now.
|
"""if name is set we will parse it now.
|
||||||
conf can have the following keys:
|
conf can have the follwing keys:
|
||||||
|
|
||||||
SRCTOPS list of tops of the src tree(s).
|
SRCTOPS list of tops of the src tree(s).
|
||||||
|
|
||||||
|
|||||||
@@ -49,10 +49,8 @@
|
|||||||
# The output, is a set of absolute paths with "SB" like:
|
# The output, is a set of absolute paths with "SB" like:
|
||||||
#.nf
|
#.nf
|
||||||
#
|
#
|
||||||
# $SB/obj-i386/bsd/gnu/lib/csu
|
|
||||||
# $SB/obj-i386/bsd/gnu/lib/libgcc
|
|
||||||
# $SB/obj-i386/bsd/include
|
# $SB/obj-i386/bsd/include
|
||||||
# $SB/obj-i386/bsd/lib/csu/i386-elf
|
# $SB/obj-i386/bsd/lib/csu/i386
|
||||||
# $SB/obj-i386/bsd/lib/libc
|
# $SB/obj-i386/bsd/lib/libc
|
||||||
# $SB/src/bsd/include
|
# $SB/src/bsd/include
|
||||||
# $SB/src/bsd/sys/i386/include
|
# $SB/src/bsd/sys/i386/include
|
||||||
@@ -77,8 +75,10 @@
|
|||||||
|
|
||||||
|
|
||||||
# RCSid:
|
# RCSid:
|
||||||
# $Id: meta2deps.sh,v 1.20 2023/01/18 01:35:24 sjg Exp $
|
# $Id: meta2deps.sh,v 1.21 2024/02/17 17:26:57 sjg Exp $
|
||||||
|
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
#
|
||||||
# Copyright (c) 2010-2013, Juniper Networks, Inc.
|
# Copyright (c) 2010-2013, Juniper Networks, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# $Id: sys.dirdeps.mk,v 1.12 2023/05/14 16:16:03 sjg Exp $
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
#
|
||||||
|
# $Id: sys.dirdeps.mk,v 1.14 2024/02/25 19:12:13 sjg Exp $
|
||||||
#
|
#
|
||||||
# @(#) Copyright (c) 2012-2023, Simon J. Gerraty
|
# @(#) Copyright (c) 2012-2023, Simon J. Gerraty
|
||||||
#
|
#
|
||||||
@@ -31,9 +33,10 @@ _PARSEDIR ?= ${.PARSEDIR:tA}
|
|||||||
|
|
||||||
.if ${.MAKE.LEVEL} == 0
|
.if ${.MAKE.LEVEL} == 0
|
||||||
# make sure dirdeps target exists and do it first
|
# make sure dirdeps target exists and do it first
|
||||||
|
# init.mk will set .MAIN to 'dirdeps' if appropriate
|
||||||
|
# as will dirdeps-targets.mk for top-level builds.
|
||||||
|
# This allows a Makefile to have more control.
|
||||||
dirdeps:
|
dirdeps:
|
||||||
# first .MAIN is what counts
|
|
||||||
.MAIN: dirdeps
|
|
||||||
.NOPATH: dirdeps
|
.NOPATH: dirdeps
|
||||||
all: dirdeps .WAIT
|
all: dirdeps .WAIT
|
||||||
.endif
|
.endif
|
||||||
|
|||||||
Reference in New Issue
Block a user