Subject: Re: cleandir phase
To: Arto Huusko <>
From: Frederick Bruckman <>
List: current-users
Date: 02/11/2003 14:10:53
On Tue, 11 Feb 2003, Arto Huusko wrote:

> On Tue, 11 Feb 2003, Patrick Welche wrote:
> > On Mon, Feb 10, 2003 at 07:46:24PM +0200, Arto Huusko wrote:
> > >
> > > 1. How come it tries to clean the directories in the source tree (which is
> > >    readonly, and doesn't matter anyway, since objdir is somewhere else).
> > >    Is this my error?
> > > 2. If 1 is fixed, should there be some intelligence that cleandir not be
> > >    done if the objdir does not exist?

> (Oh, and of course at the cleandir phase the (real) object tree did not even
> exist, so...)
> > 2. cleandir has to be done if you don't have an objdir, else the objects
> >    would be left behind in the source directory.
> Certainly, I can understand this.
> However, I had an objdir and I was just wondering why cleandir was not done
> there, but in the source directory. Of course, it didn't matter because
> there was nothing to clean in the source...

The old "bootstrap and suspenders" strategy. About the same time that
the top-level Makefile started making objdirs by default, the
toolchain went through some changes, and a lot of folks were caught
with out-of-date lex- and yacc- generated files in their source tree,
which, now being immune to cleaning, would stay forever out-of-date.
So now, by default, cleandir is run before making the objdirs.

If you know for sure you don't need that (because it's a brand, new
clean tree, or whatever), and you want to save some time, try
exporting NOCLEANDIR=yes into your environment. It looks like
will still explicitly cleandir the kernels and tools, but the main
tree should be left alone.