Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Sep 1996 05:02:22 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-current@freebsd.org, swallace@ece.uci.edu
Subject:   Re: Object directory changes to make
Message-ID:  <199609091902.FAA24911@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I like the new functionality for building the source trees, but
>I do not like removing the old functionality either.  Therefore,
>I made changes to make so that it will accompish both.

So did I :-).

>First make will search for MAKEOBJDIR.machine, then MAKEOBJDIR,
>as previously done.  Then if both failed it will search for
>MAKEOBJDIRPREFIX/`cwd`/machine and then MAKEOBJDIRPREFIX/`cwd`.
>If all fails the cwd is used.

I use an environment variable MAKEOBJTREE instead of the hard coded 
prefix MAKEOBJDIRPREFIX.  Experience showed:

1) The environment variable is too inconvenient (as expected).  It
   will have to be hard-coded for a transitional period until it can
   be read from an include file (`make' now doesn't read include files
   until after it decides the object dir.  This behaviour is fundamental
   because ifdefs etc. to control the reading of include files may depend
   on the object dir).

2) There should be no slash between MAKEOBJDIRPREFIX and `cwd`.  `cwd`
   begins with a slash (except possibly when it is actually $PWD), and
   the extra slash is unnecessary if MAKEOBJDIRPRFIX is nonempty and a
   bug otherwise.

3) .TARGETOBJDIR is bogus and unnecessary.  bsd.obj.mk can easily
   concatenate ${MAKEOBJDIRPREFIX} and ${.CURDIR} itself provided it
   knows ${MAKEOBJDIR}.  It needs to do this to get an unambiguous
   path.  Chdir checks in `make' don't work because the name of the
   path must not depend on the existence of the path.
   
   This seems to be quite broken in your version.  .TARGETOBJDIR is set
   ${path}.${MACHINE}, where ${path} is ${MAKEOBJDIR} if that is set in
   the environment, else "obj".  This seems to break both the new and
   the old tree names.

4) MAKEOBJDIRPREFIX is a better name than MAKEOBJTREE.

5) .${MACHINE} causes similar problems to ${MAKEOBJTREE}/.  It should
   be a general suffix, named ${MAKEOBJDIRSUFFIX} and any necessary
   punctuation (usually "."; perhaps "/") should be part of the suffix.
   It should not be decided inside `make'.

6) `make's builtin search path should go away.  The effect of its
   builtin "obj" path can easily be obtained using the new
   MAKEOBJDIRPREFIX.  It probably isn't necessary for the prefix to
   actually be a search path, and the ambiguity for a path usually gets
   in the way.  Overriding the prefix is probably good enough doing
   local changes.  MAKEOBJDIR didn't work before, so it won't be missed.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609091902.FAA24911>