Bug 12440 - `make distclean' failing - with patch
Summary: `make distclean' failing - with patch
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: build (show other bugs)
Version: 7.2
: P2 minor
Target Milestone: 12.1
Assignee: Tom Tromey
URL:
Keywords:
: 12869 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-26 00:10 UTC by Milo Nowak
Modified: 2022-03-01 23:55 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
patch (335 bytes, patch)
2011-01-26 00:14 UTC, Milo Nowak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Milo Nowak 2011-01-26 00:10:26 UTC
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
Comment 1 Milo Nowak 2011-01-26 00:14:02 UTC
Created attachment 5212 [details]
patch
Comment 2 Tom Tromey 2022-02-27 23:39:15 UTC
*** Bug 12869 has been marked as a duplicate of this bug. ***
Comment 3 Tom Tromey 2022-02-27 23:50:16 UTC
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.
Comment 4 Tom Tromey 2022-02-28 00:27:59 UTC
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.
Comment 5 Tom Tromey 2022-02-28 00:34:14 UTC
I sent a patch for what I could
Comment 6 Sourceware Commits 2022-03-01 23:54:28 UTC
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
Comment 7 Tom Tromey 2022-03-01 23:55:44 UTC
This is as close to fixed as we can (probably) reasonably make it.