From patchwork Mon Nov 17 11:46:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 3776 Received: (qmail 17250 invoked by alias); 17 Nov 2014 11:46:23 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 17238 invoked by uid 89); 17 Nov 2014 11:46:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Nov 2014 11:46:21 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1XqKl8-00053G-HK from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 17 Nov 2014 03:46:18 -0800 Received: from qiyao.dyndns.org.com (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.181.6; Mon, 17 Nov 2014 03:46:18 -0800 From: Yao Qi To: Subject: [RFC] Remove files in make clean Date: Mon, 17 Nov 2014 19:46:04 +0800 Message-ID: <1416224764-5607-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes 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 * Makefile.in (clean): Remove files according to .exp and .c file name in srcdir. * gdb.base/Makefile.in (EXECUTABLES): Remove some entries. --- gdb/testsuite/Makefile.in | 2 ++ gdb/testsuite/gdb.base/Makefile.in | 61 +++++++++++++------------------------- 2 files changed, 22 insertions(+), 41 deletions(-) diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in index 1c923cd..bf213eb 100644 --- a/gdb/testsuite/Makefile.in +++ b/gdb/testsuite/Makefile.in @@ -242,6 +242,8 @@ clean mostlyclean: -rm -f *.dwo *.dwp -rm -rf outputs temp cache -rm -f read1.so expect-read1 + -find ${srcdir} -name '*.exp' | sed "s/^.*testsuite\/\(.*\)\.exp/\1/" | xargs rm -rf + -find ${srcdir} -name '*.c' | sed "s/^.*testsuite\/\(.*\)\.c/\1/" | xargs rm -rf if [ x"${ALL_SUBDIRS}" != x ] ; then \ for dir in ${ALL_SUBDIRS}; \ do \ diff --git a/gdb/testsuite/gdb.base/Makefile.in b/gdb/testsuite/gdb.base/Makefile.in index dda3169..8378994 100644 --- a/gdb/testsuite/gdb.base/Makefile.in +++ b/gdb/testsuite/gdb.base/Makefile.in @@ -1,49 +1,28 @@ VPATH = @srcdir@ srcdir = @srcdir@ -EXECUTABLES = a2-run advance all-types annota1 annota1-watch_thread_num \ - annota3 anon args arrayidx async attach attach-pie-misread \ - attach2 auxv bang\! bfp-test bigcore bitfields bitfields2 \ - break break-always break-entry break-interp-test breako2 \ - breakpoint-shadow break-on-linker-gcd-function \ - call-ar-st call-rt-st call-sc-t* call-signals \ - call-strs callexit callfuncs callfwmall charset checkpoint \ - chng-syms code_elim1 code_elim2 commands compiler completion complex \ - condbreak consecutive constvars coremaker cursal cvexpr \ - dbx-test del disasm-end-cu display dprintf-pending dump dup-sect \ +EXECUTABLES = annota1-watch_thread_num \ + anon \ + bang\! \ + break-interp-test breako2 \ + call-sc-t* \ + callfwmall \ + compiler \ + dbx-test \ dup-sect.debug \ - dup-sect.stripped ending-run execd-prog expand-psymtabs exprs \ - fileio find finish fixsection float foll-exec foll-fork foll-vfork \ - frame-args freebpcmd fullname funcargs gcore \ + dup-sect.stripped \ gcore-buffer-overflow-012* \ - gdb1090 gdb11530 gdb11531 gdb1250 gdb1555-main gdb1821 gdbvars \ - hashline1 hashline2 hashline3 hbreak hook-stop-continue \ - hook-stop-frame huge included infnan info-target int-type \ - interrupt jit-main jump label langs lineinc list longjmp long_long \ - macscp mips_pro miscexprs moribund-step multi-forks nodebug \ - nofield nostdlib opaque overlays pc-fp pending permission \ - pie-execl1 pie-execl2 pointers pointers2 pr11022 prelinkt \ - prelinkt.debug prelinkt.stripped printcmds prologue psymtab \ - ptr-typedef ptype randomize recurse relational relativedebug \ - reread reread1 restore return return-nodebug-* return2 run \ - savedregs scope section_command sep sepdebug sepdebug.stripped \ - sepdebug2 sepdebug2.debug sepdebug2.stripped sepsymtab \ - sepsymtab.debug sepsymtab.stripped setshow setvar shmain shreloc \ - sigall sigaltstack sigbpt sigchld siginfo siginfo-addr \ - siginfo-infcall siginfo-obj signals signull sigrepeat sigstep \ - sizeof skip skip-solib solib solib-corrupted solib-display-main \ - solib-nodir solib-overlap-main-0x40000000 solib-symbol-main solib-weak \ - solib-weak-lib2 solib_sl so-impl-ld so-indr-cl \ - stack-checking start step-break step-bt step-line step-resume-infcall \ - step-test store structs-t* structs2 structs3 \ - symbol-without-target_section term tui-layout twice-tmp \ - type-opaque-main ui-redirect unload until unwindonsignal \ - valgrind-db-attach value-double-free varargs vforked-prog \ - volatile watch-cond watch-cond-infcall watch-non-mem watch-read \ - watch-vfork watch_thread_num watchpoint watchpoint-cond-gone \ - watchpoint-hw watchpoint-hw-hit-once watchpoint-solib watchpoints \ - wchar whatis whatis-exp catch-syscall \ - pr10179 gnu_vector + permission \ + pie-execl1 pie-execl2 pointers2 prelinkt \ + prelinkt.debug prelinkt.stripped \ + reread1 return-nodebug-* \ + section_command sepdebug.stripped \ + sepdebug2 sepdebug2.debug sepdebug2.stripped \ + sepsymtab.debug sepsymtab.stripped \ + solib-overlap-main-0x40000000 \ + solib-weak-lib2 solib_sl \ + structs-t* \ + twice-tmp MISCELLANEOUS = coremmap.data dprintf-pendshr.sl ../foobar.baz fixsectshr.sl \ pendshr.sl shreloc1.sl shreloc2.sl twice-tmp.c \