Subject: Re: how to prevent tools from being rebuilt?
To: Jukka Salmi <j+nbsd@2005.salmi.ch>
From: Greg Troxel <gdt@ir.bbn.com>
List: netbsd-users
Date: 04/13/2005 09:18:35
Jukka Salmi <j+nbsd@2005.salmi.ch> writes:

> after building a release (using HEAD sources on a current i386 system) I
> tried to build a distribution using different settings, i.e. different
> values for build.sh's -O and -D options and some MK* values turned off in
> /etc/mk.conf. However, I didn't want to rebuild the tools again, so I used
> the same -T argument as before. I did
> 
> 	$ ./build.sh -u -U -O /empty/dir1 -T /same/as/before \
> 	    -D /empty/dir2 distribution
> 
> but then most of the tools were rebuilt. Hmm, why? How should I do this
> correctly?

I believe the problem is that -O gets used for two things:

  objdir for the tools
  objdir for the build

So your tools are up to date - binary vs. source, but make verifies
the .o and such.

This is problematic for the reason you point out, but also for someone
who wants to do

./build.sh -O /obj/i386 -T /obj/tools -m i386
./build.sh -O /obj/sparc -T /obj/tools -m sparc

Tools were also rebuilt for me long ago trying this (of course
toolchain needs it, but not host tools), but after doing each build
repeating them is ok.

Further, I wanted to be able to do a build on an i386, rsync to
sparc64 and reuse the obj dirs for the sparc64 build, but of course
needed new tools.  I ended up with a fresh build from scratch, which
is ok as I felt I was asking for trouble anyway.

Perhaps a separate TOOLSOBJDIR variable is in order, defaulting to
OBJDIR, or perhaps $TOOLS/obj.

-- 
        Greg Troxel <gdt@ir.bbn.com>