5 # Our current make(1)-based approach to dependency tracking cannot cope with
6 # certain source tree changes, including:
7 # - removing source files
8 # - replacing generated files with files committed to the tree
9 # - changing file extensions (e.g. a C source file rewritten in C++)
11 # We handle those cases here in an ad-hoc fashion by looking for the known-
12 # bad case in the main .depend file, and if found deleting all of the related
13 # .depend files (including for example the lib32 version).
15 # These tests increase the build time (albeit by a small amount), so they
16 # should be removed once enough time has passed and it is extremely unlikely
17 # anyone would try a NO_CLEAN build against an object tree from before the
18 # related change. One year should be sufficient.
21 if [ ! -d "$OBJTOP" ]; then
22 echo "usage: $(basename $0) objtop" >&2
27 # $2 source filename w/o extension
31 if [ -e "$OBJTOP"/$1/.depend.$2.pico ] && \
32 egrep -qw "$2\.$3" "$OBJTOP"/$1/.depend.$2.pico; then \
33 echo "Removing stale dependencies and objects for $2.$3"; \
35 "$OBJTOP"/$1/.depend.$2.* \
37 "$OBJTOP"/obj-lib32/$1/.depend.$2.* \
38 "$OBJTOP"/obj-lib32/$1/$2.*o
42 # Date Rev Description
43 # 20200310 r358851 rename of openmp's ittnotify_static.c to .cpp
44 clean_dep lib/libomp ittnotify_static c
45 # 20200414 r359930 closefrom
46 clean_dep lib/libc closefrom S
48 # 20200826 r364746 OpenZFS merge, apply a big hammer (remove whole tree)
49 if [ -e "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o ] && \
50 egrep -qw "cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c" \
51 "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o; then
52 echo "Removing old ZFS tree"
53 rm -rf "$OBJTOP"/cddl "$OBJTOP"/obj-lib32/cddl
56 # 20200916 WARNS bumped, need bootstrapped crunchgen stubs
57 if [ -e "$OBJTOP"/rescue/rescue/rescue.c ] && \
58 ! grep -q 'crunched_stub_t' "$OBJTOP"/rescue/rescue/rescue.c; then
59 echo "Removing old rescue(8) tree"
60 rm -rf "$OBJTOP"/rescue/rescue
63 # 20210105 fda7daf06301 pfctl gained its own version of pf_ruleset.c
64 if [ -e "$OBJTOP"/sbin/pfctl/.depend.pf_ruleset.o ] && \
65 egrep -qw "sys/netpfil/pf/pf_ruleset.c" \
66 "$OBJTOP"/sbin/pfctl/.depend.pf_ruleset.o; then
67 echo "Removing old pf_ruleset dependecy file"
68 rm -rf "$OBJTOP"/sbin/pfctl/.depend.pf_ruleset.o
71 # 20210108 821aa63a0940 non-widechar version of ncurses removed
72 if [ -e "$OBJTOP"/lib/ncurses/ncursesw ]; then
73 echo "Removing stale ncurses objects"
74 rm -rf "$OBJTOP"/lib/ncurses "$OBJTOP"/obj-lib32/lib/ncurses
77 # 20210608 f20893853e8e move from atomic.S to atomic.c
78 clean_dep cddl/lib/libspl atomic S
79 # 20211207 cbdec8db18b5 switch to libthr-friendly pdfork
80 clean_dep lib/libc pdfork S
82 # 20220524 68fe988a40ca kqueue_test binary replaced shell script
83 if stat "$OBJTOP"/tests/sys/kqueue/libkqueue/*kqtest* \
84 "$OBJTOP"/tests/sys/kqueue/libkqueue/.depend.kqtest* >/dev/null 2>&1; then
85 echo "Removing old kqtest"
86 rm -f "$OBJTOP"/tests/sys/kqueue/libkqueue/.depend.* \
87 "$OBJTOP"/tests/sys/kqueue/libkqueue/*