Sync latest versions
This commit is contained in:
parent
69e6d7b75e
commit
876336c858
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/bmake/; revision=249458
@ -1,4 +1,4 @@
|
||||
# $Id: dirdeps.mk,v 1.24 2013/02/10 19:21:46 sjg Exp $
|
||||
# $Id: dirdeps.mk,v 1.28 2013/03/25 21:11:43 sjg Exp $
|
||||
|
||||
# Copyright (c) 2010-2013, Juniper Networks, Inc.
|
||||
# All rights reserved.
|
||||
@ -86,19 +86,29 @@
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# # variables other than MACHINE might be optional
|
||||
# # Always list MACHINE first,
|
||||
# # other variables might be optional.
|
||||
# TARGET_SPEC_VARS = MACHINE TARGET_OS
|
||||
# .if ${TARGET_SPEC:Uno:M*,*} != ""
|
||||
# _tspec := ${TARGET_SPEC:S/,/ /g}
|
||||
# MACHINE := ${_tspec:[1]}
|
||||
# TARGET_OS := ${_tspec:[2]}
|
||||
# # etc.
|
||||
# # We need to stop that TARGET_SPEC affecting any submakes
|
||||
# # and deal with MACHINE=${TARGET_SPEC} in the environment.
|
||||
# TARGET_SPEC =
|
||||
# # export but do not track
|
||||
# .export-env TARGET_SPEC
|
||||
# .export ${TARGET_SPEC_VARS}
|
||||
# .for v in ${TARGET_SPEC_VARS:O:u}
|
||||
# .if empty($v)
|
||||
# .undef $v
|
||||
# .endif
|
||||
# .endfor
|
||||
# .endif
|
||||
# # make sure we know what TARGET_SPEC is
|
||||
# # as we may need it to find Makefile.depend*
|
||||
# TARGET_SPEC = ${TARGET_SPEC_VARS:@v@${$v:U}@:ts,}
|
||||
#
|
||||
|
||||
.if ${.MAKE.LEVEL} == 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: gendirdeps.mk,v 1.12 2013/02/10 19:59:10 sjg Exp $
|
||||
# $Id: gendirdeps.mk,v 1.21 2013/03/28 20:01:05 sjg Exp $
|
||||
|
||||
# Copyright (c) 2010-2013, Juniper Networks, Inc.
|
||||
# All rights reserved.
|
||||
@ -119,7 +119,7 @@ META2DEPS_CMD = ${_time} ${PYTHON} ${META2DEPS} ${_py_d} \
|
||||
META2DEPS_CMD += -D ${DPDEPS}
|
||||
.endif
|
||||
|
||||
M2D_OBJROOTS += ${OBJTOP}/ ${_OBJROOT} ${_objroot}
|
||||
M2D_OBJROOTS += ${OBJTOP} ${_OBJROOT} ${_objroot}
|
||||
.if defined(SB_OBJROOT)
|
||||
M2D_OBJROOTS += ${SB_OBJROOT}
|
||||
.endif
|
||||
@ -174,7 +174,12 @@ dir_list += ${f:H:tA}
|
||||
.endfor
|
||||
.if !empty(ddep_list)
|
||||
ddeps != cat ${ddep_list:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \
|
||||
sed 's,//*$$,,;s,\.${HOST_TARGET}$$,.host,'
|
||||
sed 's,//*$$,,;s,\.${HOST_TARGET}$$,.host,;s,\.${MACHINE}$$,,'
|
||||
|
||||
.if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != ""
|
||||
.info ${RELDIR}: raw_dir_list='${dir_list}'
|
||||
.info ${RELDIR}: ddeps='${ddeps}'
|
||||
.endif
|
||||
dir_list += ${ddeps}
|
||||
.endif
|
||||
.endif
|
||||
@ -188,8 +193,10 @@ dir_list += ${ddeps}
|
||||
# so we add
|
||||
# ${"${dir_list:M*bsd/sys/${MACHINE_ARCH}/include}":?bsd/include:}
|
||||
# to GENDIRDEPS_DIR_LIST_XTRAS
|
||||
_objtops = ${OBJTOP} ${_OBJTOP} ${_obtop}
|
||||
_objtops := ${_objtops:O:u}
|
||||
dirdep_list = \
|
||||
${dir_list:M${_objtop}*/*:C,${_objtop}[^/]*/,,} \
|
||||
${_objtops:@o@${dir_list:M$o*/*:C,$o[^/]*/,,}@} \
|
||||
${GENDIRDEPS_DIR_LIST_XTRAS}
|
||||
|
||||
# sort longest first
|
||||
@ -198,10 +205,11 @@ M2D_OBJROOTS := ${M2D_OBJROOTS:O:u:[-1..1]}
|
||||
# anything we use from an object dir other than ours
|
||||
# needs to be qualified with its .<machine> suffix
|
||||
# (we used the pseudo machine "host" for the HOST_TARGET).
|
||||
skip_ql= ${SRCTOP}* ${_objtop}*
|
||||
skip_ql= ${SRCTOP}* ${_objtops:@o@$o*@}
|
||||
.for o in ${M2D_OBJROOTS:${skip_ql:${M_ListToSkip}}}
|
||||
qualdir_list += \
|
||||
${dir_list:${skip_ql:${M_ListToSkip}}:M$o*/*/*:C,$o([^/]+)/(.*),\2.\1,:S,.${HOST_TARGET},.host,}
|
||||
# we need := so only skip_ql to this point applies
|
||||
ql := ${dir_list:${skip_ql:${M_ListToSkip}}:M$o*/*/*:C,$o([^/]+)/(.*),\2.\1,:S,.${HOST_TARGET},.host,}
|
||||
qualdir_list += ${ql}
|
||||
skip_ql+= $o*
|
||||
.endfor
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: meta.autodep.mk,v 1.28 2012/07/13 15:38:16 sjg Exp $
|
||||
# $Id: meta.autodep.mk,v 1.32 2012/11/13 00:44:26 sjg Exp $
|
||||
|
||||
#
|
||||
# @(#) Copyright (c) 2010, Simon J. Gerraty
|
||||
@ -235,6 +235,7 @@ META_FILES = ${.MAKE.META.FILES:T:N.depend*:N*o.meta:O:u} \
|
||||
.export GENDIRDEPS_FILTER
|
||||
.endif
|
||||
|
||||
# we might have .../ in MAKESYSPATH
|
||||
_makesyspath:= ${_PARSEDIR}
|
||||
${_DEPENDFILE}: ${_depend} ${.PARSEDIR}/gendirdeps.mk ${META2DEPS} $${.MAKE.META.CREATED}
|
||||
@echo Checking $@: ${.OODATE:T:[1..8]}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: meta.stage.mk,v 1.22 2013/03/08 17:52:11 sjg Exp $
|
||||
# $Id: meta.stage.mk,v 1.24 2013/03/23 02:25:19 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2011, Simon J. Gerraty
|
||||
#
|
||||
@ -48,17 +48,21 @@ GENDIRDEPS_FILTER += Nnot-empty-is-important \
|
||||
${_STAGED_DIRS:O:u:M${OBJTOP}*:S,${OBJTOP}/,N,} \
|
||||
${_STAGED_DIRS:O:u:N${OBJTOP}*:S,${_objroot},,:C,^([^/]+)/(.*),N\2.\1,:S,${HOST_TARGET},.host,}
|
||||
|
||||
LN_CP_SCRIPT = LnCp() { \
|
||||
rm -f $$2 2> /dev/null; \
|
||||
ln $$1 $$2 2> /dev/null || \
|
||||
cp -p $$1 $$2; }
|
||||
|
||||
# it is an error for more than one src dir to try and stage
|
||||
# the same file
|
||||
STAGE_DIRDEP_SCRIPT = StageDirdep() { \
|
||||
STAGE_DIRDEP_SCRIPT = ${LN_CP_SCRIPT}; StageDirdep() { \
|
||||
t=$$1; \
|
||||
if [ -s $$t.dirdep ]; then \
|
||||
cmp -s .dirdep $$t.dirdep && return; \
|
||||
echo "ERROR: $$t installed by `cat $$t.dirdep` not ${_dirdep}" >&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
ln .dirdep $$t.dirdep 2> /dev/null || \
|
||||
cp .dirdep $$t.dirdep || exit 1; }
|
||||
LnCp .dirdep $$t.dirdep || exit 1; }
|
||||
|
||||
# common logic for staging files
|
||||
# this all relies on RELDIR being set to a subdir of SRCTOP
|
||||
@ -71,9 +75,7 @@ STAGE_FILE_SCRIPT = ${STAGE_DIRDEP_SCRIPT}; StageFiles() { \
|
||||
for f in "$$@"; do \
|
||||
case "$$f" in */*) t=$$dest/${_stage_file_basename};; *) t=$$dest/$$f;; esac; \
|
||||
StageDirdep $$t; \
|
||||
rm -f $$t; \
|
||||
{ ln $$f $$t 2> /dev/null || \
|
||||
cp -p $$f $$t; } || exit 1; \
|
||||
LnCp $$f $$t || exit 1; \
|
||||
[ -z "$$mode" ] || chmod $$mode $$t; \
|
||||
done; :; }
|
||||
|
||||
@ -103,9 +105,7 @@ STAGE_AS_SCRIPT = ${STAGE_DIRDEP_SCRIPT}; StageAs() { \
|
||||
case "$$1" in */*) mkdir -p ${_stage_target_dirname};; esac; \
|
||||
shift; \
|
||||
StageDirdep $$t; \
|
||||
rm -f $$t; \
|
||||
{ ln $$s $$t 2> /dev/null || \
|
||||
cp -p $$s $$t; } || exit 1; \
|
||||
LnCp $$s $$t || exit 1; \
|
||||
[ -z "$$mode" ] || chmod $$mode $$t; \
|
||||
done; :; }
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
"""
|
||||
RCSid:
|
||||
$Id: meta2deps.py,v 1.10 2013/03/17 03:10:09 sjg Exp $
|
||||
$Id: meta2deps.py,v 1.12 2013/03/31 22:31:59 sjg Exp $
|
||||
|
||||
Copyright (c) 2011-2013, Juniper Networks, Inc.
|
||||
All rights reserved.
|
||||
@ -196,9 +196,17 @@ def __init__(self, name, conf={}):
|
||||
if not _srctop in self.srctops:
|
||||
self.srctops.append(_srctop)
|
||||
|
||||
trim_list = ['/' + self.machine, '/' + self.machine + '/']
|
||||
trim_list = ['/' + self.machine + '/',
|
||||
'/' + self.machine,
|
||||
self.machine + '/',
|
||||
self.machine]
|
||||
|
||||
if self.machine == 'host':
|
||||
trim_list += ['/' + self.host_target, '/' + self.host_target + '/']
|
||||
trim_list += ['/' + self.host_target + '/',
|
||||
'/' + self.host_target,
|
||||
self.host_target + '/',
|
||||
self.host_target]
|
||||
|
||||
for objroot in getv(conf, 'OBJROOTS', []):
|
||||
for e in trim_list:
|
||||
if objroot.endswith(e):
|
||||
@ -237,6 +245,8 @@ def __init__(self, name, conf={}):
|
||||
if not self.reldir:
|
||||
self.dpdeps = None # we cannot do it?
|
||||
|
||||
self.cwd = os.getcwd() # make sure this is initialized
|
||||
|
||||
if name:
|
||||
self.parse()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user