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

next in thread | raw e-mail | index | archive | help
>>>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.

Why .machine in one case and /machine in the other case?

>> 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.
>I put that there for easy reading...not in code.

OK.

>> 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.
>>    
>I agree it should be done away with.  Do we want to do that now?

Just don't use it for now.

>> 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'.
>Huh?

`make' is sure to use "." when you want "/", etc.  The naming policy
shouldn't be there.

>> 6) `make's builtin search path should go away.  The effect of its

>It would be nice if the object directory could be set by the makefile
>or an include file, but until then the search path is needed.
>With MAKEOBJDIRPREFIX, MAKEOBJDIR is not needed to build the src tree.
>However, it is still needed for compatability for other trees users
>have built using previous FreeBSD releases.

Except it didn't work :-).  It worked if it was a relative path, but
MAKEOBJDIR=/any resulted in objdir == obpath == "" after a successful
chdir(path) in the non-mdpath case.

>I am confused.  What would you like to do?
>I would like to put my changes into place until major changes
>to allow the makefile/include to determine the object directory.

Just make some minor changes:

1) Nuke .TARGETOBJDIR.  It can be defined as
.TARGETOBJDIR= ${MAKEOBJTREE}${.CURDIR} for a quick fix (it should be
renamed CANONICALOBJDIR or something like that).

2) Give MAKEOBJDIRPREFIX priority over both the "obj" and the "/usr/obj"
prefixes.

3) Warn in a central makefile when ${.OBJDIR} != ${CANONICALOBJDIR}
(&& maybe ${.OBJDIR} != ${.CURDIR} or maybe if ${.OBJDIR} = ${.CURDIR}/obj).
This will be useful for detecting stale ./obj directories and links.  If
you really want to use a nonstandard CANONICALOBJDIR and not get a warning,
then you can set MAKEOBJDIR or MAKEOBJDIRPREFIX.  I like to a ./obj
directory for debugging without touch the object tree, and a warning for
the ./obj's that I forget about would be useful.

Bruce



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