|
1 | | -# $Id: gendirdeps.mk,v 1.51 2025/01/05 01:16:19 sjg Exp $ |
| 1 | +# $Id: gendirdeps.mk,v 1.54 2025/08/12 21:36:43 sjg Exp $ |
2 | 2 |
|
3 | 3 | # SPDX-License-Identifier: BSD-2-Clause |
4 | 4 | # |
5 | | -# Copyright (c) 2011-2020, Simon J. Gerraty |
| 5 | +# Copyright (c) 2011-2025, Simon J. Gerraty |
6 | 6 | # Copyright (c) 2010-2018, Juniper Networks, Inc. |
7 | 7 | # All rights reserved. |
8 | 8 | # |
|
76 | 76 | # |
77 | 77 | .MAIN: all |
78 | 78 |
|
| 79 | +.if ${DEBUG_GENDIRDEPS:Uno:@m@${RELDIR:M$m}@} != "" |
| 80 | +_debug.gendirdeps = 1 |
| 81 | +.else |
| 82 | +_debug.gendirdeps = 0 |
| 83 | +.endif |
| 84 | + |
79 | 85 | # keep this simple |
80 | 86 | .MAKE.MODE = compat |
81 | 87 |
|
@@ -108,6 +114,9 @@ META_FILES += ${META_XTRAS:N\*.meta} |
108 | 114 | .endif |
109 | 115 |
|
110 | 116 | .if !empty(META_FILES) |
| 117 | +.if ${_debug.gendirdeps} && ${DEBUG_GENDIRDEPS:Mmeta*} != "" |
| 118 | +.info ${RELDIR}: META_FILES=${META_FILES} |
| 119 | +.endif |
111 | 120 |
|
112 | 121 | .if ${.MAKE.LEVEL} > 0 && !empty(GENDIRDEPS_FILTER) |
113 | 122 | # so we can compare below |
@@ -146,7 +155,7 @@ GENDIRDEPS_FILTER += ${GENDIRDEPS_FILTER_VARS:@v@S,/${$v}/,/_{${v}}/,@:NS,//,*:u |
146 | 155 | META2DEPS ?= ${.PARSEDIR}/meta2deps.sh |
147 | 156 | META2DEPS := ${META2DEPS} |
148 | 157 |
|
149 | | -.if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != "" && ${DEBUG_GENDIRDEPS:Uno:Mmeta2d*} != "" |
| 158 | +.if ${_debug.gendirdeps} && ${DEBUG_GENDIRDEPS:Mmeta2d*} != "" |
150 | 159 | _time = time |
151 | 160 | _sh_x = sh -x |
152 | 161 | _py_d = -ddd |
@@ -260,7 +269,7 @@ dpadd_dir_list += ${f:H:tA} |
260 | 269 | ddeps != cat ${ddep_list:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \ |
261 | 270 | sed ${GENDIRDEPS_SEDCMDS} |
262 | 271 |
|
263 | | -.if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != "" |
| 272 | +.if ${_debug.gendirdeps} |
264 | 273 | .info ${RELDIR}: raw_dir_list='${dir_list}' |
265 | 274 | .info ${RELDIR}: ddeps='${ddeps}' |
266 | 275 | .endif |
@@ -289,12 +298,13 @@ M2D_OBJROOTS := ${M2D_OBJROOTS:O:u:[-1..1]} |
289 | 298 | # anything we use from an object dir other than ours |
290 | 299 | # needs to be qualified with its .<machine> suffix |
291 | 300 | # (we used the pseudo machine "host" for the HOST_TARGET). |
292 | | -skip_ql= ${SRCTOP}* ${_objtops:@o@$o*@} |
| 301 | +skip_ql = ${SRCTOP}* ${_objtops:@o@$o*@} |
| 302 | +M_ListToSkip ?= O:u:S,^,N,:ts: |
293 | 303 | .for o in ${M2D_OBJROOTS:${skip_ql:${M_ListToSkip}}} |
294 | 304 | # we need := so only skip_ql to this point applies |
295 | 305 | ql.$o := ${dir_list:${skip_ql:${M_ListToSkip}}:M$o*/*/*:C,$o([^/]+)/(.*),\2.\1,:S,.${HOST_TARGET},.host,} |
296 | 306 | qualdir_list += ${ql.$o} |
297 | | -.if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != "" |
| 307 | +.if ${_debug.gendirdeps} |
298 | 308 | .info ${RELDIR}: o=$o ${ql.$o qualdir_list:L:@v@$v=${$v}@} |
299 | 309 | .endif |
300 | 310 | skip_ql+= $o* |
@@ -323,7 +333,7 @@ DIRDEPS += \ |
323 | 333 | GENDIRDEPS_FILTER_MASK += @CMNS |
324 | 334 | DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER:UNno:M[${GENDIRDEPS_FILTER_MASK:O:u:ts}]*:ts:}:C,//+,/,g:O:u} |
325 | 335 |
|
326 | | -.if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != "" |
| 336 | +.if ${_debug.gendirdeps} |
327 | 337 | .info ${RELDIR}: M2D_OBJROOTS=${M2D_OBJROOTS} |
328 | 338 | .info ${RELDIR}: M2D_EXCLUDES=${M2D_EXCLUDES} |
329 | 339 | .info ${RELDIR}: dir_list='${dir_list}' |
|
0 commit comments