Re: [PATCH] Tidy up 'clean' make target



Hi Steven,

<snip>

> I object. The use of globbing is just plain bad form in Makefiles. Given
>
> PYSRCS          := a b c d e f g
> then the right thing to do is to explicitly say
>
> PYS             := ${PYSRCS:%=%.py}
> PYCS            := ${SRCS:%=%.pyc}

I agree if we were talking about a project with C-files where the list
of files to compile is defined by a variable already.  However with
python your usage scenario isn't as ideal.  We don't currently create
a list of files to compile, so we don't have a list of files to
delete.  You could artificially create a variable like PYSRCS, but
you'd have to update it every time a source file is added, deleted, or
moved.  This burden doesn't seem worth the minimal gain to me.

Also, the old method was already using globbing to an extent, just on
a directory-by-directory basis instead of the all-directories approach
I prefer.

It seems like in projects the "clean" target is frequently forgotten.
In general people care more about getting their change to work than
they are about cleaning up the aftermath.  Using the globbing method
helps to reduce future errors such as the one that I was attempting to
fix (leftover .install files).

> Delete what you own and own what you delete.

I agree in theory, but in practice (at least in this case) I
personally think the benefit of a generic (and arguably
over-aggressive) "clean" target outweighs the burden of maintaining a
list of files to be removed.

Best,
Peter


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]