git: 82fcae46051c - stable/13 - depend-cleanup.sh: Simplify the logic, and clean bootstrap tools.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 09 Dec 2024 21:48:55 UTC
The branch stable/13 has been updated by brooks:
URL: https://cgit.FreeBSD.org/src/commit/?id=82fcae46051c3e395585d07e9bbfb8ef5f92a391
commit 82fcae46051c3e395585d07e9bbfb8ef5f92a391
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-02-08 22:58:51 +0000
Commit: Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2024-12-09 21:46:29 +0000
depend-cleanup.sh: Simplify the logic, and clean bootstrap tools.
* There's no need to check if the file exists before grepping it; if it does not exist, grep will fail, which is what we want. Just redirect the error message to /dev/null.
* There's no need to split the .o and .pico cases; the bodies are identical, so combine the conditions. Use a glob to avoid a false negative if one exists but not the other.
* Also run depend-cleanup.sh on the bootstrap build tree. This unbreaks the build after 29c5f8bf9a01.
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D38447
(cherry picked from commit 0dfaefa975477cee2ec3155c3e0689ba1fcdde9a)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1543
---
Makefile.inc1 | 3 +++
tools/build/depend-cleanup.sh | 11 ++---------
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/Makefile.inc1 b/Makefile.inc1
index fc5e82d39eca..48cd0f1c772c 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1084,6 +1084,9 @@ _bootstrap-tools:
@echo "--------------------------------------------------------------"
@echo ">>> stage 1.2: bootstrap tools"
@echo "--------------------------------------------------------------"
+.if ${MK_CLEAN} != "yes"
+ ${_+_}cd ${.CURDIR}; ${BMAKE} _NO_INCLUDE_COMPILERMK=t _cleanobj_fast_depend_hack
+.endif
${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/casper ${WORLDTMP}/lib/geom \
${WORLDTMP}/bin
diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh
index fd0d7eb01fe7..fd29c50593a5 100755
--- a/tools/build/depend-cleanup.sh
+++ b/tools/build/depend-cleanup.sh
@@ -27,15 +27,8 @@ fi
# $3 source extension
clean_dep()
{
- if [ -e "$OBJTOP"/$1/.depend.$2.pico ] && \
- egrep -qw "$2\.$3" "$OBJTOP"/$1/.depend.$2.pico; then \
- echo "Removing stale dependencies and objects for $2.$3"; \
- rm -f \
- "$OBJTOP"/$1/.depend.$2.* \
- "$OBJTOP"/$1/$2.*o
- fi
- if egrep -qw "$2\.$3" "$OBJTOP"/obj-lib32/$1/.depend.$2.*o 2>/dev/null; then
- echo "Removing 32-bit stale dependencies and objects for $2.$3"
+ if egrep -qw "$2\.$3" "$OBJTOP"/$1/.depend.$2.*o 2>/dev/null; then
+ echo "Removing stale dependencies and objects for $2.$3"
rm -f \
"$OBJTOP"/obj-lib32/$1/.depend.$2.* \
"$OBJTOP"/obj-lib32/$1/$2.*o