This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Remove files in make clean


On Mon, Nov 17, 2014 at 3:46 AM, Yao Qi <yao@codesourcery.com> wrote:
> Hi,
> I am looking at how 'make clean' in testsuite/ directory remove files
> generated during testing.  We manually maintain a list of
> executables and shared libraries in Makefile.in, and they are removed
> in 'make clean'.  However, the list will be stale as the code evolves.
> I am wondering a better approach than the current one.  I find
> that name of most the executables is the same as the name of .exp or
> .c file, so I modify clean target in testsuite/Makefile.in to delete
> executables according to the name of .exp and .c file, in a
> speculative way.  As a result, the manually maintained list in
> testsuite/gdb.XXX/Makefile.in is shorter, only executables, which are
> not covered by the speculation, should be listed.  So this approach
> is a hybrid approach, that is most of the executables can be removed,
> without any special care and special care is needed for the rest of them.
>
> This is a RFC, because I'd like ask people's opinion on this.  If it
> is good, I'll update other gdb.XXX/Makefile.in.
>
> gdb/testsuite:
>
> 2014-11-17  Yao Qi  <yao@codesourcery.com>
>
>         * Makefile.in (clean):  Remove files according to .exp and .c
>         file name in srcdir.
>         * gdb.base/Makefile.in (EXECUTABLES): Remove some entries.

Removing files according to .exp/.c is still fragile.
Still, it feels like a step in the right direction.

When we run in parallel mode all the output goes in the "outputs" subdir.
This leads to the thought that
IWBN if all one had to do is an rm -rf.
IOW, the only "make clean" rule would be in gdb/testsuite/Makefile.in
and it would just rm -rf the outputs subdirectory (however it is spelled -
I *like* having parallel runs stored separately from non-parallel ones).
But that breaks common usage that I do of running one test and then
expecting to find the binary in testsuite/gdb.foo.

OTOH, given the simplicity and completeness of the rm -rf approach,
I'd be ok with adjusting my muscle-memory (typing habits) and
going with just always putting test output in a subdir.
With a well chosen name it would tab-complete well,
and require little extra typing.

Do we need all the testsuite/*/Makefile files for anything else?
Would going the "always put test output in a subdir" route
allow us to remove all of them?  That's appealing.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]