Lines Matching +full:tf +full:- +full:a
4 # meta2deps.sh - extract useful info from .meta files
21 # CMD "command-line"
24 # -- command output --
25 # -- filemon acquired metadata --
35 # The fact that all the syscall entry lines start with a single
38 # To simplify the logic the 'CWD' line is made to look like a
49 # The output, is a set of absolute paths with "SB" like:
52 # $SB/obj-i386/bsd/include
53 # $SB/obj-i386/bsd/lib/csu/i386
54 # $SB/obj-i386/bsd/lib/libc
58 # $SB/src/pan-release/rtsock
59 # $SB/src/pfe-shared/include/jnx
65 # outside of "CURDIR" we read, we output a line like:
72 # up with a list of all the directories which depend on each src
80 # SPDX-License-Identifier: BSD-2-Clause
82 # Copyright (c) 2011-2025, Simon J. Gerraty
83 # Copyright (c) 2010-2013, Juniper Networks, Inc.
98 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
109 sed -n '/^R .*\.[chyl]$/s,^..[0-9]* ,,p' |
110 sort -u
115 sed -n '/^R .*\/.*\.[a-z0-9][^\/]*$/s,^..[0-9]* \(.*\)/[^/]*$,\1,p' |
116 sort -u
126 -s) suffix="$2"; shift 2;;
143 # some Linux systems have deprecated egrep in favor of grep -E
145 case "`echo bmake | egrep 'a|b' 2>&1`" in
147 *) egrep() { grep -E "$@"; }
151 egrep -v "$EXCLUDES"
168 -a) MACHINE_ARCH=$2; shift 2;;
169 -m) MACHINE=$2; shift 2;;
170 -C) CURDIR=$2; shift 2;;
171 -H) HOST_TARGET=$2; shift 2;;
172 -S) add_list SRCTOPS $2; shift 2;;
173 -O) add_list OBJROOTS $2; shift 2;;
174 -X) add_list EXCLUDES '|' $2; shift 2;;
175 -R) RELDIR=$2; shift 2;;
176 -T) TARGET_SPEC=$2; shift 2;;
190 *$MACHINE*|*${TARGET_SPEC:-$MACHINE}*) ;;
210 OBJTOP=$o${TARGET_SPEC:-$MACHINE}
217 add_list '|' -s '/*' src_re $SRCTOPS
218 add_list '|' -s '*' obj_re $OBJROOTS
220 [ -z "$RELDIR" ] && unset DPDEPS
221 tf=/tmp/m2d$$-$USER
222 rm -f $tf.*
223 trap 'rm -f $tf.*; trap 0' 0
225 > $tf.dirdep
226 > $tf.qual
227 > $tf.srcdep
228 > $tf.srcrel
229 > $tf.dpdeps
252 sed -e 's,^CWD,C C,;/^[#CREFLMVWX] /!d' -e "s,',,g" |
257 # first a sanity check - filemon on Linux is not very reliable
258 # path2 should only be non-empty for op L or M
271 if [ -z "$SB" ]; then
274 SRCTOP=${SRCTOP:-$SB/src}
289 [1-9]*)
294 eval ldir=\${ldir_$pid:-$CWD} cwd=\${cwd_$pid:-$CWD}
309 test -d ${cwd:-/dev/null/no/such} || cwd=$CWD
322 case `'ls' -l $path 2> /dev/null | sed 's, .*,,'` in
340 test -e $path && break
366 ${CURDIR:-.}|"") continue;;
383 if [ -d $path ]; then
390 [ -f $path ] || continue
395 echo $dir >> $tf.srcdep
399 echo "DPDEPS_$dir/${path##*/} += $RELDIR" >> $tf.dpdeps
405 # if there is a .dirdep we cannot skip
407 if [ -s $path.dirdep ]; then
410 echo $path.dirdep >> $tf.qual
412 elif [ -s $dir.dirdep ]; then
413 echo $dir.dirdep >> $tf.qual
422 done > $tf.dirdep
440 for f in $tf.dirdep $tf.qual $tf.srcdep
442 [ -s $f ] || continue
444 *qual) # a list of .dirdep files
450 xargs cat < $f | sort -u |
451 sed "s,^# ,,;s,^,$OBJTOP/,;s,\.${TARGET_SPEC:-$MACHINE}\$,,;s,\.$MACHINE\$,,"
453 *) sort -u $f;;
457 if [ -s $tf.dpdeps ]; then
462 sort -u $tf.dpdeps |
463 sed "s,${SRCTOP}/,,;s,${SB_BACKING_SB:-$SB}/src/,," >> $DPDEPS
465 # ensure we produce _something_ else egrep -v gets upset