diff options
author | Jessica Clarke <jrtc27@FreeBSD.org> | 2023-07-27 04:10:47 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2024-12-09 21:46:55 +0000 |
commit | 50291c77306be87ee9f85fe557d47b65c8af50ed (patch) | |
tree | 0bbd9c9ae72dd7e648fe8c43c77e137b08d0e33b /tools/build | |
parent | 0f00a4c39b65172f3e12bf7e12d31c1b4bc40e34 (diff) |
depend-cleanup.sh: Generalise lib32 code and avoid duplication
By passing through _ALL_libcompats we can avoid hard-coding the list of
libcompats in depend-cleanup.sh. This cleanup also makes clean_dep
shorter by using a loop instead of handling each case explicitly (at the
expense of slightly tweaked logging).
Reviewed by: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D41187
(cherry picked from commit 81805ec30074363e5d7d7add37b3ccf4f1eb396b)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1543
Diffstat (limited to 'tools/build')
-rwxr-xr-x | tools/build/depend-cleanup.sh | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index e88a765357a5..7299ee0ccf6b 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -72,6 +72,9 @@ if [ -z "${MACHINE_ARCH+set}" ]; then err "MACHINE_ARCH not set" fi +# XXX: _ALL_libcompats not MFC'd in Makefile.inc1 +ALL_libcompats=32 + run() { if [ "$VERBOSE" ]; then @@ -87,12 +90,15 @@ run() # $3 source extension clean_dep() { - if egrep -qw "$2\.$3" "$OBJTOP"/$1/.depend.$2.*o 2>/dev/null; then - echo "Removing stale dependencies and objects for $2.$3" - run rm -f \ - "$OBJTOP"/obj-lib32/$1/.depend.$2.* \ - "$OBJTOP"/obj-lib32/$1/$2.*o - fi + for libcompat in "" $ALL_libcompats; do + dirprfx=${libcompat:+obj-lib${libcompat}/} + if egrep -qw "$2\.$3" "$OBJTOP"/$dirprfx$1/.depend.$2.*o 2>/dev/null; then + echo "Removing stale ${libcompat:+lib${libcompat} }dependencies and objects for $2.$3" + run rm -f \ + "$OBJTOP"/$dirprfx$1/.depend.$2.* \ + "$OBJTOP"/$dirprfx$1/$2.*o + fi + done } # Date Rev Description @@ -106,7 +112,10 @@ if [ -e "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o ] && \ egrep -qw "cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c" \ "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o; then echo "Removing old ZFS tree" - run rm -rf "$OBJTOP"/cddl "$OBJTOP"/obj-lib32/cddl + for libcompat in "" $ALL_libcompats; do + dirprfx=${libcompat:+obj-lib${libcompat}/} + run rm -rf "$OBJTOP"/${dirprfx}cddl + done fi # 20200916 WARNS bumped, need bootstrapped crunchgen stubs @@ -127,7 +136,10 @@ fi # 20210108 821aa63a0940 non-widechar version of ncurses removed if [ -e "$OBJTOP"/lib/ncurses/ncursesw ]; then echo "Removing stale ncurses objects" - run rm -rf "$OBJTOP"/lib/ncurses "$OBJTOP"/obj-lib32/lib/ncurses + for libcompat in "" $ALL_libcompats; do + dirprfx=${libcompat:+obj-lib${libcompat}/} + run rm -rf "$OBJTOP"/${dirprfx}lib/ncurses + done fi # 20210608 f20893853e8e move from atomic.S to atomic.c |