The clean target

William Jon McCann mccann at jhu.edu
Wed Mar 14 06:01:32 PDT 2007


Hey,

On 3/14/07, Rob Taylor <rob.taylor at codethink.co.uk> wrote:
> Richard Hughes wrote:
> > On 14/03/07, Stepan Kasal <kasal at ucw.cz> wrote:
> >> Hello,
> >>   I noticed that the MAINTAINERCLEAN variable contains Makefile.in,
> >> at least in some subdirectories.  (One of the side-effects of the
> >> gtk-doc patch, if I have not missed something.)
> >>
> >> I do not think this is right, the `maintainer-clean' target should
> >> leave the tree in a state when ./configure is possible.
> >
> > I always use as a general rule:
> >
> > make clean: removes all generated stuff not in a tarball, still allows
> > user to ./configure
> > make distclean: removes all generated stuff not in VCS, user has to
> > ./autogen.sh
> > make maintainerclean: removes some stuff that might need odd tools to
> > generate, like firmware headers and the like. User needs ./autogen.sh
> > and some odd other tools.
> >
> > Maybe there's a more concrete rule of thumb on the net somewhere, but
> > I always thought maintainerclean nuked everything not code.
>
> Not quite right there, Richard ;) see
>
> http://www.gnu.org/prep/standards/html_node/Standard-Targets.html
> and
> http://www.gnu.org/software/automake/manual/html_node/Clean.html

Interesting.  I have to admit that I've never read that.  However, I
learned this practice from having seen it done on lots of other
projects.  I suspect the reason that so many people use this practice
is that it solves a very common problem for maintainers, namely: how
to clean all files generated by autogen.sh.

http://www.google.com/codesearch?hl=en&q=+MAINTAINERCLEAN+Makefile.in
Lots of other fdo projects do this too - like cairo etc.

So, I guess you're right that it wasn't the intended usage but I think
it has become common practice.

Jon


More information about the hal mailing list