after compilation `make distclean' is failing to remove old config.caches: gdb-7.2]$: find . -name config.cache ./bfd/config.cache ./etc/config.cache ./gdb/config.cache ./intl/config.cache ./libdecnumber/config.cache ./libiberty/config.cache ./opcodes/config.cache ./readline/config.cache ./sim/config.cache gdb-7.2]$: make distclean make[1]: Entering directory `/home/milo/srcs/gdb-7.2' make[1]: Nothing to be done for `distclean-target'. make[1]: Leaving directory `/home/milo/srcs/gdb-7.2' rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log rm -f Makefile config.status config.cache mh-frag mt-frag rm -f maybedep.tmp serdep.tmp if [ "x86_64-unknown-linux-gnu" != "." ]; then \ rm -rf x86_64-unknown-linux-gnu; \ else true; fi rm -rf build-x86_64-unknown-linux-gnu if [ "." != "." ]; then \ rm -rf .; \ else true; fi rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile rm -f texinfo/doc/Makefile texinfo/po/POTFILES rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null make: [local-distclean] Error 1 (ignored) rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null make: [local-distclean] Error 1 (ignored) rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null make: [local-distclean] Error 1 (ignored) find . -name config.cache -exec rm -f {} \; \; 2>/dev/null make: [local-distclean] Error 1 (ignored) gdb-7.2]$: find . -name config.cache ./bfd/config.cache ./etc/config.cache ./gdb/config.cache ./intl/config.cache ./libdecnumber/config.cache ./libiberty/config.cache ./opcodes/config.cache ./readline/config.cache ./sim/config.cache that's because of repeated `\;' in find invocation: Makefile.in:2661: -find . -name config.cache -exec rm -f {} \; \; 2>/dev/null Makefile.tpl:774: -find . -name config.cache -exec rm -f {} \; \; 2>/dev/null silly one but patch attached anyway. -- Regards, Milo
Created attachment 5212 [details] patch
*** Bug 12869 has been marked as a duplicate of this bug. ***
distclean has some issues in gdb. Those we can fix but the other ones have to be done via binutils or, in one case, upstream in gcc.
One issue with fixing 'distclean' is that we can't remove $(YYFILES) since that will break the case of a source distribution with included yacc-generated files when configured in-tree. In this case we'd delete files that came from the dist. It seems to me that "distclean" is only really useful in-tree. Out-of-tree, I just delete the whole build directory and start over.
I sent a patch for what I could
The master branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c675db743ec2634f1f5f185fa8a6e73eb59447f7 commit c675db743ec2634f1f5f185fa8a6e73eb59447f7 Author: Tom Tromey <tom@tromey.com> Date: Sun Feb 27 17:31:54 2022 -0700 Some "distclean" fixes in gdb PR build/12440 points out that "make distclean" is broken in gdb. Most of the breakage comes from other projects in the tree, but we can fix some of the issues, which is what this patch does. Note that the yacc output files, like c-exp.c, are left alone. In a source distribution, these are included in the tarball, and if the user builds in-tree, we would not want to remove them. While that seems a bit obscure, it seems to me that "distclean" is only really useful for in-tree builds anyway -- out-of-tree I simply delete the entire build directory and start over. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=12440
This is as close to fixed as we can (probably) reasonably make it.