autoconf
[Top][All Lists]
Advanced

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

Re: autoreconf --clean


From: Stepan Kasal
Subject: Re: autoreconf --clean
Date: Thu, 15 Mar 2007 19:11:23 +0100
User-agent: Mutt/1.4.2.1i

Hello,

  ``No, no, it ain't me, you are looking for, babe!''
                                --Robert Zimmermann

On Wed, Mar 14, 2007 at 10:33:26PM -0600, Bob Proulx wrote:
> David Byron wrote:
> > I'm trying to find a way to remove all the files that autoreconf -fvi puts
> > in my source directory.  This feels like something that someone else must
> > have dealt with or at least thought about before.  It seems like a --clean
> > option to autoreconf would do the trick.
> 
> The 'make maintainer-clean' automake generated target will almost do
> what you want.

not at all.

This is an urban legend about maintainer-clean.

maintainer-clean is by no means a way to delete everything but the
primary sources.  You are supposed to be able to reconfigure after
you run it.

I see there is a need for an undo-bootstrap or undo-autoreconf
command, but maintainer-clean is not what you are looking for.

> You could add the additional files to the variable
> MAINTAINERCLEANFILES and then everything would be cleaned up.

maintainer-clean, as generated by Automake, is almost identical to
distclean.  To make substantial differences, you have to set
MAINTAINERCLEANFILES.

I see people are adding Makefile.in and such to MAINTAINERCLEANFILES
to twist maintainer-clean into undo-bootstrap, but that's not the
way.

Let's be more exact now:
GNU Coding Standards say this:

                                        [...] running the command
     `make maintainer-clean' should not delete `configure' even if
     `configure' can be remade using a rule in the Makefile.  More
     generally, `make maintainer-clean' should not delete anything that
     needs to exist in order to run `configure' and then begin to build
     the program.  This is the only exception; `maintainer-clean' should
     delete everything else that can be rebuilt.

Let's look more closely to the list of files mentioned in the
original post:

> > aclocal.m4
> > autom4te.cache
> > config.guess
> > config.h.in
> > config.sub
> > configure
> > depcomp
> > install-sh
> > missing
> > and all the Makefile.in's generated from Makefile.am's

- autom4te.cache -- removed by maintainer-clean, but this is the only one

- configure -- has to stay by definition
- config.guess, config.sub -- called by configure, hence have to stay
- config.h.in, the Makefile.in's -- templates instantiated by
  configure, so they have to stay too

- aclocal.m4 -- strictly speaking, this is not needed, but if we
  removed it, it would trigger regeneration of configure and
  Makefile.in's, which is turn would trigger another run of configure
  So it is clear that is has to stay to enable the function of
  configure.

- depcomp, install-sh, missing -- well, these file cannot be
  ``rebuilt'' because they are just copied in by Automake.
  As it stands now, adding them to MAINTAINERCLEANFILES would break
        ./confgiure && make
  after maintainer-clean, which would violate the quote above.

In short, maintainer-clean deletes all generated file, but not the
files generated/brought-in by autotools.

Regarding the bets about what autoreconf knows:
autoreconf just calls half dozen other tools, and _they_ know which
files they create.
Some of us prefer a simple shell script, say bootstrap.sh, which
does this on half dozen lines.

Anyway, I think one one would have to amend all these tools (autoconf,
autoheader, aclocal, automake, autopoint (from gettext)) and
implement --clean in each of them first.

It might be quite a lot of work; volunteers welcome.  ;-)

All the best,
        Stepan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]