[Python-checkins] r43040 - python/trunk/Makefile.pre.in

Thomas Heller theller at python.net
Wed Mar 15 16:03:45 CET 2006


Hye-Shik Chang wrote:
> On 3/15/06, Thomas Heller <theller at python.net> wrote:
>> thomas.heller wrote:
>>> Author: thomas.heller
>>> Date: Wed Mar 15 09:34:38 2006
>>> New Revision: 43040
>>>
>>> Modified:
>>>    python/trunk/Makefile.pre.in
>>> Log:
>>> In 'make clean', delete some files that are generated by the _ctypes/libffi
>>> configure step.
>>>
>>>
>>> Modified: python/trunk/Makefile.pre.in
>>> ==============================================================================
>>> --- python/trunk/Makefile.pre.in      (original)
>>> +++ python/trunk/Makefile.pre.in      Wed Mar 15 09:34:38 2006
>>> @@ -974,6 +974,8 @@
>>>       find . -name '*.o' -exec rm -f {} ';'
>>>       find . -name '*.s[ol]' -exec rm -f {} ';'
>>>       find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
>>> +     find $(srcdir) -name 'fficonfig.h' -exec rm -f {} ';'
>>> +     find $(srcdir) -name 'fficonfig.py' -exec rm -f {} ';'
>>>
>>>  clobber: clean
>>>       -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
>> Although I committed this, I'm not sure this is the right approach.
>> Better IMO would be to let 'make clean' run '$(srcdir)/python setup.py clean'
>> or '$(srcdir)/python setup.py clean -a', and let the setup script take care
>> of the cleanup.  The problem is that the makefile doesn't know what the build
>> directory for extensions is, since its name is determined by distutils.
> 
> fficonfig.* looks much like pyconfig.h which is not cleaned by the `clean'
> target.  I think `clobber' or `distclean' makes more fit for fficonfig.*.

Let's stay with this approach for a moment.  The above code is bad because it also
removes the non-generated source files in Modules/_ctypes/libffi_msvc/ and 
Modules/_ctypes/libffi_arm_wince/.

To repair it I'd suggest:

>>> +     find $(srcdir)/build -name 'fficonfig.h' -exec rm -f {} ';' || true
>>> +     find $(srcdir)/build -name 'fficonfig.py' -exec rm -f {} ';' || true

This removes only files in the build subdirectory, and ignores the 'find' error
when the build directory is not there.

Thomas



More information about the Python-checkins mailing list