[issue4007] make clean fails to delete .a and .so.X.Y files

Skip Montanaro report at bugs.python.org
Fri Apr 9 14:17:54 CEST 2010

Skip Montanaro <skip at pobox.com> added the comment:

Martin> If it did eat the patch, we would have lost it by now: there is
    Martin> nothing in the history that shows that a file was attached at
    Martin> some point. More likely, Skip forgot to attach it when
    Martin> submitting this report.

Yeah, I must have just forgotten to attach it.  At one point I'm pretty sure
I had something in my sandbox, but have nothing now.  Removing .a files is
pretty straightforward.  Removing .so.X.Y files is a little more cumbersome
because globbing isn't perfect.  This (only lightly tested) patch should be
good enough though:

Index: Makefile.pre.in
--- Makefile.pre.in     (revision 79207)
+++ Makefile.pre.in     (working copy)
@@ -1156,8 +1156,9 @@
        find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'

 clean: pycremoval
-       find . -name '*.o' -exec rm -f {} ';'
+       find . -name '*.[oa]' -exec rm -f {} ';'
        find . -name '*.s[ol]' -exec rm -f {} ';'
+       find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
        find build -name 'fficonfig.h' -exec rm -f {} ';' || true
        find build -name 'fficonfig.py' -exec rm -f {} ';' || true
        -rm -f Lib/lib2to3/*Grammar*.pickle

even though the second addition would also match files like




Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list