git: a650ec0e55a9 - main - lib{c,sys}: fix incremental builds

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Fri, 08 Mar 2024 19:19:34 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=a650ec0e55a9e0511321fd3e311bbd3aa46bcb12

commit a650ec0e55a9e0511321fd3e311bbd3aa46bcb12
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2024-03-08 19:14:24 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2024-03-08 19:14:24 +0000

    lib{c,sys}: fix incremental builds
    
    I removed lib/libsys/{aarch64,arm,riscv}/syscall.S in favor of an
    idential generated version.  We need to clean out the .ddepend files to
    ensure the generated version is actually generated.
    
    The guard here is technically too strict, but should be fine in practice
    and I've verified both the breakage and fix on an armv7 build.
    
    Reported by:    imp
    Fixes:          e6ffc7669a56 Remove pointless MD syscall(2)
    Fixes:          0ee0ae237324 Remove pointless MD syscall(2)
    Fixes:          7b3836c28188 Remove pointless MD syscall(2)
---
 tools/build/depend-cleanup.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh
index 4dfe694d5c0a..e327ee40a6df 100755
--- a/tools/build/depend-cleanup.sh
+++ b/tools/build/depend-cleanup.sh
@@ -218,3 +218,13 @@ clean_dep   lib/libc        fstatfs       c
 clean_dep   lib/libc        getdirentries c
 clean_dep   lib/libc        getfsstat     c
 clean_dep   lib/libc        statfs        c
+
+# 20240308  e6ffc7669a56    Remove pointless MD syscall(2)
+# 20240308  0ee0ae237324    Remove pointless MD syscall(2)
+# 20240308  7b3836c28188    Remove pointless MD syscall(2)
+if [ ${MACHINE} != i386 -a -f "$OBJTOP"/lib/libsys/.depend.syscall.o && \
+    grep -eq 'libsys/[^ /]*/syscall.S' "$OBJTOP"/lib/libsys/.depend.syscall.*; then
+	echo "Removing stale <arch>/syscall.S depends"
+	clean_dep   lib/libsys  syscall S
+	clean_dep   lib/libc    syscall S
+fi